fix(postgresql): use for major update pgautoupgrade

This commit is contained in:
WrenIX 2024-10-01 15:17:44 +02:00
parent c30caa3763
commit ce6eea5496
Signed by: wrenix
GPG key ID: 7AFDB012974B1BB5
4 changed files with 88 additions and 9 deletions

View file

@ -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

View file

@ -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"`

View file

@ -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 }}

View file

@ -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