From 175b33aeb293332b73e6eb1547745104c58469cf Mon Sep 17 00:00:00 2001 From: kjeld Schouten-Lebbing Date: Fri, 13 Aug 2021 23:43:13 +0200 Subject: [PATCH] simplify postgresql folder setup --- charts/stable/postgresql/Chart.yaml | 2 +- charts/stable/postgresql/SCALE/ix_values.yaml | 4 +--- charts/stable/postgresql/SCALE/questions.yaml | 12 ++++++------ .../postgresql/templates/backup-postgres-config.yaml | 2 +- .../templates/upgrade-backup-postgres-hook.yaml | 4 +--- charts/stable/postgresql/values.yaml | 7 +++---- 6 files changed, 13 insertions(+), 18 deletions(-) diff --git a/charts/stable/postgresql/Chart.yaml b/charts/stable/postgresql/Chart.yaml index a165f5cef96..d87ac370c83 100644 --- a/charts/stable/postgresql/Chart.yaml +++ b/charts/stable/postgresql/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v2 kubeVersion: ">=1.16.0-0" name: postgresql -version: 1.0.0 +version: 1.0.1 appVersion: "auto" description: PostgresSQL type: application diff --git a/charts/stable/postgresql/SCALE/ix_values.yaml b/charts/stable/postgresql/SCALE/ix_values.yaml index 289680cbfff..783acfd3202 100644 --- a/charts/stable/postgresql/SCALE/ix_values.yaml +++ b/charts/stable/postgresql/SCALE/ix_values.yaml @@ -9,7 +9,6 @@ image: pullPolicy: IfNotPresent tag: "13.3" -pgdatapath: "/data" envValueFrom: POSTGRES_PASSWORD: @@ -18,7 +17,6 @@ envValueFrom: key: "postgresql-password" envTpl: - PGDATA: "{{ .Values.pgdatapath }}" POSTGRES_USER: "{{ .Values.postgresqlUsername }}" POSTGRES_DB: "{{ .Values.postgresqlDatabase }}" # POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}" @@ -27,4 +25,4 @@ envTpl: ## # Most other defaults are set in questions.yaml # For other options please refer to the wiki, default_values.yaml or the common library chart -## \ No newline at end of file +## diff --git a/charts/stable/postgresql/SCALE/questions.yaml b/charts/stable/postgresql/SCALE/questions.yaml index cba17461a37..a6b144d9cac 100644 --- a/charts/stable/postgresql/SCALE/questions.yaml +++ b/charts/stable/postgresql/SCALE/questions.yaml @@ -76,7 +76,7 @@ questions: description: "RollingUpdate: Create new pods and then kill old ones" - value: "OnDelete" description: "(Legacy) OnDelete: ignore .spec.template changes" - + - variable: env group: "Container Configuration" label: "Image Environment" @@ -253,8 +253,8 @@ questions: schema: type: dict attrs: - - variable: data - label: "App data Storage" + - variable: db + label: "App db Storage" description: "Stores the Application Database." schema: type: dict @@ -330,7 +330,7 @@ questions: description: "Path inside the container the storage is mounted" schema: type: string - default: "/data" + default: "/var/lib/postgresql/data" hidden: true - variable: medium label: "EmptyDir Medium" @@ -364,7 +364,7 @@ questions: type: string default: "100Gi" - - variable: backups + - variable: dbbackups label: "App backup Storage" description: "Stores the Application backups." schema: @@ -441,7 +441,7 @@ questions: description: "Path inside the container the storage is mounted" schema: type: string - default: "/backups" + default: "/dbbackups" hidden: true - variable: medium label: "EmptyDir Medium" diff --git a/charts/stable/postgresql/templates/backup-postgres-config.yaml b/charts/stable/postgresql/templates/backup-postgres-config.yaml index 7e102d3532f..b350f44035b 100644 --- a/charts/stable/postgresql/templates/backup-postgres-config.yaml +++ b/charts/stable/postgresql/templates/backup-postgres-config.yaml @@ -12,4 +12,4 @@ data: until pg_isready; do sleep 5; done; - pg_dump -U $POSTGRES_USER -d {{ .Values.postgresqlDatabase }} > /backups/$BACKUP_NAME; + pg_dump -U $POSTGRES_USER -d {{ .Values.postgresqlDatabase }} > /dbbackups/$BACKUP_NAME; diff --git a/charts/stable/postgresql/templates/upgrade-backup-postgres-hook.yaml b/charts/stable/postgresql/templates/upgrade-backup-postgres-hook.yaml index 808f5595f24..05a226d8e9e 100644 --- a/charts/stable/postgresql/templates/upgrade-backup-postgres-hook.yaml +++ b/charts/stable/postgresql/templates/upgrade-backup-postgres-hook.yaml @@ -25,8 +25,6 @@ spec: env: - name: BACKUP_NAME value: {{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}} - - name: PGDATA - value: {{ .Values.pgdatapath | quote }} - name: POSTGRES_USER value: {{ .Values.postgresqlUsername | quote }} - name: POSTGRES_DB @@ -55,4 +53,4 @@ spec: {{- nindent 2 . }} {{- end }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} diff --git a/charts/stable/postgresql/values.yaml b/charts/stable/postgresql/values.yaml index 16bb1f2c011..a834d43b722 100644 --- a/charts/stable/postgresql/values.yaml +++ b/charts/stable/postgresql/values.yaml @@ -15,15 +15,15 @@ service: port: 5432 persistence: - data: + db: enabled: true type: emptyDir - backups: + mountPath: "/var/lib/postgresql/data" + dbbackups: enabled: true type: emptyDir -pgdatapath: "/data" postgresqlPassword: "testpass" postgresqlUsername: "test" postgresqlDatabase: "test" @@ -37,7 +37,6 @@ envValueFrom: key: "postgresql-password" envTpl: - PGDATA: "{{ .Values.pgdatapath }}" POSTGRES_USER: "{{ .Values.postgresqlUsername }}" POSTGRES_DB: "{{ .Values.postgresqlDatabase }}" # POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}"