From a796e64e76f8ae86d7903dbaafef1c4fbcb83113 Mon Sep 17 00:00:00 2001 From: wilmardo Date: Tue, 26 Nov 2019 12:27:42 +0100 Subject: [PATCH 1/2] fix: for k8s set PGDATA to subfolder Signed-off-by: wilmardo --- k8s/example2-single-statefulset/nodes/node.yml | 4 +++- k8s/helm/PostDock/templates/postgres/statefulset.yaml | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/k8s/example2-single-statefulset/nodes/node.yml b/k8s/example2-single-statefulset/nodes/node.yml index c07c5792..ddb97a16 100644 --- a/k8s/example2-single-statefulset/nodes/node.yml +++ b/k8s/example2-single-statefulset/nodes/node.yml @@ -68,6 +68,8 @@ spec: secretKeyRef: name: mysystem-secret key: app.db.password + - name: PGDATA + value: /var/lib/postgresql/data/pgdata # Cluster configs - name: "CLUSTER_NAME" @@ -94,7 +96,7 @@ spec: - containerPort: 5432 volumeMounts: - name: db-data - mountPath: /var/lib/postgresql/data + mountPath: /var/lib/postgresql/data/pgdata volumeClaimTemplates: - metadata: name: db-data diff --git a/k8s/helm/PostDock/templates/postgres/statefulset.yaml b/k8s/helm/PostDock/templates/postgres/statefulset.yaml index e4e6e59d..12f76022 100644 --- a/k8s/helm/PostDock/templates/postgres/statefulset.yaml +++ b/k8s/helm/PostDock/templates/postgres/statefulset.yaml @@ -64,6 +64,8 @@ spec: secretKeyRef: name: {{ .Values.postDock.name }}-secret key: app.db.password + - name: PGDATA + value: /var/lib/postgresql/data/pgdata - name: "CLUSTER_NAME" valueFrom: configMapKeyRef: @@ -88,7 +90,7 @@ spec: - containerPort: 5432 volumeMounts: - name: db-data - mountPath: /var/lib/postgresql/data + mountPath: /var/lib/postgresql/data/pgdata volumeClaimTemplates: - metadata: name: db-data From c6ded6ae55eea571acc32d6415441f58974858b4 Mon Sep 17 00:00:00 2001 From: wilmardo Date: Tue, 26 Nov 2019 12:27:42 +0100 Subject: [PATCH 2/2] fix: restore the mountPath to what is was Signed-off-by: wilmardo --- k8s/example2-single-statefulset/nodes/node.yml | 2 +- k8s/helm/PostDock/templates/postgres/statefulset.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/k8s/example2-single-statefulset/nodes/node.yml b/k8s/example2-single-statefulset/nodes/node.yml index ddb97a16..81ff6647 100644 --- a/k8s/example2-single-statefulset/nodes/node.yml +++ b/k8s/example2-single-statefulset/nodes/node.yml @@ -96,7 +96,7 @@ spec: - containerPort: 5432 volumeMounts: - name: db-data - mountPath: /var/lib/postgresql/data/pgdata + mountPath: /var/lib/postgresql/data volumeClaimTemplates: - metadata: name: db-data diff --git a/k8s/helm/PostDock/templates/postgres/statefulset.yaml b/k8s/helm/PostDock/templates/postgres/statefulset.yaml index 12f76022..fee76f8a 100644 --- a/k8s/helm/PostDock/templates/postgres/statefulset.yaml +++ b/k8s/helm/PostDock/templates/postgres/statefulset.yaml @@ -90,7 +90,7 @@ spec: - containerPort: 5432 volumeMounts: - name: db-data - mountPath: /var/lib/postgresql/data/pgdata + mountPath: /var/lib/postgresql/data volumeClaimTemplates: - metadata: name: db-data