diff --git a/postgresql/Chart.yaml b/postgresql/Chart.yaml index 53d8be9..c1f0079 100644 --- a/postgresql/Chart.yaml +++ b/postgresql/Chart.yaml @@ -4,9 +4,9 @@ name: "postgresql" description: "A Helm chart for running PostgreSQL (Postgres) database" icon: https://wiki.postgresql.org/images/a/a4/PostgreSQL_logo.3colors.svg type: "application" -version: "0.1.10" +version: "0.2.0" # renovate: image=docker.io/library/postgres -appVersion: "16.4-alpine" +appVersion: "17.0-alpine" maintainers: - name: WrenIX url: https://wrenix.eu diff --git a/postgresql/README.adoc b/postgresql/README.adoc index f536e5f..74cbb7a 100644 --- a/postgresql/README.adoc +++ b/postgresql/README.adoc @@ -2,9 +2,9 @@ = postgresql -image::https://img.shields.io/badge/Version-0.1.10-informational?style=flat-square[Version: 0.1.10] +image::https://img.shields.io/badge/Version-0.2.0-informational?style=flat-square[Version: 0.2.0] image::https://img.shields.io/badge/Version-application-informational?style=flat-square[Type: application] -image::https://img.shields.io/badge/AppVersion-16.4-alpine-informational?style=flat-square[AppVersion: 16.4-alpine] +image::https://img.shields.io/badge/AppVersion-17.0-alpine-informational?style=flat-square[AppVersion: 17.0-alpine] == Maintainers .Maintainers @@ -52,11 +52,51 @@ helm uninstall postgresql-release | `{}` | +| autoupgrade.enabled +| bool +| `true` +| + +| autoupgrade.image.pullPolicy +| string +| `"IfNotPresent"` +| + +| autoupgrade.image.registry +| string +| `"docker.io"` +| + +| autoupgrade.image.repository +| string +| `"pgautoupgrade/pgautoupgrade"` +| + +| autoupgrade.image.tag +| string +| `"17-alpine"` +| + +| autoupgrade.securityContext +| object +| `{}` +| + | fullnameOverride | string | `""` | +| global.image.pullPolicy +| string +| `nil` +| if set it will overwrite all pullPolicy + +| global.image.registry +| string +| `nil` +| if set it will overwrite all registry entries + | image.pullPolicy | string | `"IfNotPresent"` diff --git a/postgresql/templates/statefulset.yaml b/postgresql/templates/statefulset.yaml index 389d628..5c2f284 100644 --- a/postgresql/templates/statefulset.yaml +++ b/postgresql/templates/statefulset.yaml @@ -29,12 +29,32 @@ spec: serviceAccountName: {{ include "postgresql.serviceAccountName" . }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} + {{- with .Values.autoupgrade }} + {{- if .enabled }} + initContainers: + - name: upgrade + securityContext: + {{- toYaml .securityContext | nindent 12 }} + {{- with .image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} + env: + - name: "PGAUTO_ONESHOT" + value: "yes" + volumeMounts: + - name: "data" + mountPath: "/var/lib/postgresql/data" + {{- end }}{{/* end-if autoupgrade.enabled */}} + {{- end }}{{/* end-with autoupgrade */}} containers: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- with .Values.image }} + image: "{{ coalesce $.Values.global.image.registry .registry }}/{{ .repository }}:{{ .tag | default $.Chart.AppVersion }}" + imagePullPolicy: {{ coalesce $.Values.global.image.pullPolicy .pullPolicy }} + {{- end }} env: - name: "POSTGRES_PASSWORD" value: {{ .Values.postgres.password | quote }} diff --git a/postgresql/values.yaml b/postgresql/values.yaml index df2c333..139fc70 100644 --- a/postgresql/values.yaml +++ b/postgresql/values.yaml @@ -1,6 +1,9 @@ -# Default values for postgresql. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. +global: + image: + # -- if set it will overwrite all registry entries + registry: + # -- if set it will overwrite all pullPolicy + pullPolicy: image: registry: docker.io @@ -115,3 +118,19 @@ job: # owner: "existing_user_which_will_get_grant" # additionalParams: "" # Optional databases: {} + +autoupgrade: + enabled: true + image: + registry: docker.io + repository: pgautoupgrade/pgautoupgrade + pullPolicy: IfNotPresent + tag: "17-alpine" + + securityContext: {} + # capabilities: + # drop: + # - ALL + # readOnlyRootFilesystem: true + # runAsNonRoot: true + # runAsUser: 1000