diff --git a/pkg/helm/README.md b/pkg/helm/README.md index a719ecf78a1..7120effbcad 100644 --- a/pkg/helm/README.md +++ b/pkg/helm/README.md @@ -35,6 +35,7 @@ The chart should dump its version and appVersion in the Chart.yaml file every re | `preferences.data` | Preferences to load | `{}` | | `resources.*` | Allocated requests and limits resources | `{"requests": {...}, "limits": {...}}` | | `persistence.enabled` | PVC resource creation | `true` | +| `persistence.existingClaim` | Provide existing PVC instead of creating one | `""` | | `service.type` | Service type | `"ClusterIP"` | | `service.loadBalancerIP` | Load balancer IP (Only if service.type is LoadBalancer) | `""` | | `ingress.enabled` | Ingress resource creation | `false` | diff --git a/pkg/helm/templates/deployment.yaml b/pkg/helm/templates/deployment.yaml index b2c6c4620c3..5c12294868b 100644 --- a/pkg/helm/templates/deployment.yaml +++ b/pkg/helm/templates/deployment.yaml @@ -66,7 +66,7 @@ spec: {{- if .Values.persistence.enabled }} - name: data persistentVolumeClaim: - claimName: {{ template "pgadmin4.fullname" . }} + claimName: {{ .Values.persistence.existingClaim | default (include "pgadmin4.fullname" .) }} {{- end }} {{- if .Values.config_local.enabled }} - name: config-local diff --git a/pkg/helm/templates/pvc.yaml b/pkg/helm/templates/pvc.yaml index 74cc7c40ee0..ffbe215ccdd 100644 --- a/pkg/helm/templates/pvc.yaml +++ b/pkg/helm/templates/pvc.yaml @@ -1,4 +1,4 @@ -{{- if .Values.persistence.enabled }} +{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} apiVersion: v1 kind: PersistentVolumeClaim metadata: @@ -17,4 +17,4 @@ spec: requests: storage: {{ .Values.persistence.size }} accessModes: {{ .Values.persistence.accessModes }} -{{- end }} \ No newline at end of file +{{- end }} diff --git a/pkg/helm/values.yaml b/pkg/helm/values.yaml index cedbb2bb994..47b8da5bf74 100644 --- a/pkg/helm/values.yaml +++ b/pkg/helm/values.yaml @@ -88,6 +88,7 @@ persistence: size: 1Gi storageClass: "" accessModes: ["ReadWriteOnce"] + existingClaim: "" service: type: ClusterIP @@ -179,4 +180,3 @@ containerSecurityContext: type: RuntimeDefault windowsOptions: hostProcess: false -