simplify postgresql folder setup

This commit is contained in:
kjeld Schouten-Lebbing
2021-08-13 23:43:13 +02:00
parent 19877edf3b
commit 175b33aeb2
6 changed files with 13 additions and 18 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
apiVersion: v2 apiVersion: v2
kubeVersion: ">=1.16.0-0" kubeVersion: ">=1.16.0-0"
name: postgresql name: postgresql
version: 1.0.0 version: 1.0.1
appVersion: "auto" appVersion: "auto"
description: PostgresSQL description: PostgresSQL
type: application type: application
@@ -9,7 +9,6 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: "13.3" tag: "13.3"
pgdatapath: "/data"
envValueFrom: envValueFrom:
POSTGRES_PASSWORD: POSTGRES_PASSWORD:
@@ -18,7 +17,6 @@ envValueFrom:
key: "postgresql-password" key: "postgresql-password"
envTpl: envTpl:
PGDATA: "{{ .Values.pgdatapath }}"
POSTGRES_USER: "{{ .Values.postgresqlUsername }}" POSTGRES_USER: "{{ .Values.postgresqlUsername }}"
POSTGRES_DB: "{{ .Values.postgresqlDatabase }}" POSTGRES_DB: "{{ .Values.postgresqlDatabase }}"
# POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}" # POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}"
@@ -27,4 +25,4 @@ envTpl:
## ##
# Most other defaults are set in questions.yaml # Most other defaults are set in questions.yaml
# For other options please refer to the wiki, default_values.yaml or the common library chart # For other options please refer to the wiki, default_values.yaml or the common library chart
## ##
@@ -76,7 +76,7 @@ questions:
description: "RollingUpdate: Create new pods and then kill old ones" description: "RollingUpdate: Create new pods and then kill old ones"
- value: "OnDelete" - value: "OnDelete"
description: "(Legacy) OnDelete: ignore .spec.template changes" description: "(Legacy) OnDelete: ignore .spec.template changes"
- variable: env - variable: env
group: "Container Configuration" group: "Container Configuration"
label: "Image Environment" label: "Image Environment"
@@ -253,8 +253,8 @@ questions:
schema: schema:
type: dict type: dict
attrs: attrs:
- variable: data - variable: db
label: "App data Storage" label: "App db Storage"
description: "Stores the Application Database." description: "Stores the Application Database."
schema: schema:
type: dict type: dict
@@ -330,7 +330,7 @@ questions:
description: "Path inside the container the storage is mounted" description: "Path inside the container the storage is mounted"
schema: schema:
type: string type: string
default: "/data" default: "/var/lib/postgresql/data"
hidden: true hidden: true
- variable: medium - variable: medium
label: "EmptyDir Medium" label: "EmptyDir Medium"
@@ -364,7 +364,7 @@ questions:
type: string type: string
default: "100Gi" default: "100Gi"
- variable: backups - variable: dbbackups
label: "App backup Storage" label: "App backup Storage"
description: "Stores the Application backups." description: "Stores the Application backups."
schema: schema:
@@ -441,7 +441,7 @@ questions:
description: "Path inside the container the storage is mounted" description: "Path inside the container the storage is mounted"
schema: schema:
type: string type: string
default: "/backups" default: "/dbbackups"
hidden: true hidden: true
- variable: medium - variable: medium
label: "EmptyDir Medium" label: "EmptyDir Medium"
@@ -12,4 +12,4 @@ data:
until pg_isready; do until pg_isready; do
sleep 5; sleep 5;
done; done;
pg_dump -U $POSTGRES_USER -d {{ .Values.postgresqlDatabase }} > /backups/$BACKUP_NAME; pg_dump -U $POSTGRES_USER -d {{ .Values.postgresqlDatabase }} > /dbbackups/$BACKUP_NAME;
@@ -25,8 +25,6 @@ spec:
env: env:
- name: BACKUP_NAME - name: BACKUP_NAME
value: {{- printf "postgres-backup-from-%s-to-%s-revision-%d" $upgradeDict.oldChartVersion $upgradeDict.newChartVersion (int64 $upgradeDict.preUpgradeRevision) -}} 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 - name: POSTGRES_USER
value: {{ .Values.postgresqlUsername | quote }} value: {{ .Values.postgresqlUsername | quote }}
- name: POSTGRES_DB - name: POSTGRES_DB
@@ -55,4 +53,4 @@ spec:
{{- nindent 2 . }} {{- nindent 2 . }}
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
+3 -4
View File
@@ -15,15 +15,15 @@ service:
port: 5432 port: 5432
persistence: persistence:
data: db:
enabled: true enabled: true
type: emptyDir type: emptyDir
backups: mountPath: "/var/lib/postgresql/data"
dbbackups:
enabled: true enabled: true
type: emptyDir type: emptyDir
pgdatapath: "/data"
postgresqlPassword: "testpass" postgresqlPassword: "testpass"
postgresqlUsername: "test" postgresqlUsername: "test"
postgresqlDatabase: "test" postgresqlDatabase: "test"
@@ -37,7 +37,6 @@ envValueFrom:
key: "postgresql-password" key: "postgresql-password"
envTpl: envTpl:
PGDATA: "{{ .Values.pgdatapath }}"
POSTGRES_USER: "{{ .Values.postgresqlUsername }}" POSTGRES_USER: "{{ .Values.postgresqlUsername }}"
POSTGRES_DB: "{{ .Values.postgresqlDatabase }}" POSTGRES_DB: "{{ .Values.postgresqlDatabase }}"
# POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}" # POSTGRESQL_POSTGRES_PASSWORD: "{{ .Values.postgrespassword }}"