diff --git a/postgresql/Chart.yaml b/postgresql/Chart.yaml index b61c3835e9f0b0cea0638c540d4eaa3c7ff84555..d9c8e14119a57c88b2e17a44baf9dce48196c8bd 100644 --- a/postgresql/Chart.yaml +++ b/postgresql/Chart.yaml @@ -2,5 +2,5 @@ apiVersion: v2 name: postgresql description: Helm Chart for postgresql type: application -version: 1.4.0 -appVersion: "15" +version: 1.7.0 +appVersion: "17" diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index ff4496be8d71a2302107c5751f21020c6713f530..ce0a8ce0e222be5fa9b714da3923314c31889b20 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -6,6 +6,10 @@ metadata: {{- include "postgresql-helm.labels" . | nindent 4 }} spec: replicas: {{ .Values.replicaCount }} + updateStrategy: + type: RollingUpdate + rollingUpdate: + maxUnavailable: "100%" serviceName: {{ include "postgresql-helm.fullname" . }} selector: matchLabels: @@ -41,6 +45,40 @@ spec: - emptyDir: medium: Memory name: shm + {{- if .Values.updater.enabled }} + initContainers: + - name: updater + image: "{{ .Values.updater.repository }}:{{ .Values.updater.tag | default (printf "%s-alpine" .Chart.AppVersion) }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: + - name: PGAUTO_ONESHOT + value: "yes" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + key: "postgres-password" + name: {{ include "postgresql-helm.fullname" . }} + securityContext: + runAsUser: 0 + volumeMounts: + - mountPath: "/var/lib/postgresql/data" + name: data + subPath: "{{ .Chart.AppVersion }}/data" + - mountPath: "/configs" + name: config + - mountPath: "/dev/shm" + name: shm + {{ if .Values.tls.enabled -}} + - mountPath: "/certs/tls.crt" + name: certs + subPath: tls.crt + - mountPath: "/certs/tls.key" + name: certs + subPath: tls.key + {{- end }} + resources: + {{- toYaml .Values.resources | nindent 12 }} + {{- end }} containers: - name: postgresql securityContext: diff --git a/postgresql/values.yaml b/postgresql/values.yaml index 68115af6090752b97846bd073b84b89a64cb63cf..723439b62b19b59058c2839b379a4b86afb811b9 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -5,6 +5,12 @@ image: pullPolicy: IfNotPresent tag: "" +updater: + enabled: false + repository: pgautoupgrade/pgautoupgrade + pullPolicy: IfNotPresent + tag: "" + imagePullSecrets: [ ] nameOverride: "" fullnameOverride: ""