diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 1b3a65ad31..341be96e32 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -56,6 +56,8 @@ spec: secretKeyRef: name: {{ .Values.secrets.postgresql.admin }} key: 'POSTGRES_USER' + - name: 'PGDATA' + value: {{ .Values.storage.mount.path | quote }} livenessProbe: exec: command: @@ -71,7 +73,8 @@ spec: {{ tuple $envAll $envAll.Values.pod.resources.server | include "helm-toolkit.snippets.kubernetes_resources" | indent 10 }} volumeMounts: - name: postgresql-data - mountPath: /var/lib/postgresql + mountPath: {{ .Values.storage.mount.path }} + subPath: {{ .Values.storage.mount.subpath }} {{- if not .Values.storage.pvc.enabled }} volumes: - name: postgresql-data diff --git a/postgresql/values.yaml b/postgresql/values.yaml index 884df07e51..148ed54918 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -51,6 +51,9 @@ storage: class_path: volume.beta.kubernetes.io/storage-class host: host_path: /data/openstack-helm/postgresql + mount: + path: /var/lib/postgresql/data + subpath: pgdata labels: node_selector_key: openstack-control-plane