Skip to content
Snippets Groups Projects
Verified Commit cf20e9d9 authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

feat: add auto updater to postgres

parent 5b4a5b87
No related branches found
No related tags found
No related merge requests found
Pipeline #3061 passed
...@@ -2,5 +2,5 @@ apiVersion: v2 ...@@ -2,5 +2,5 @@ apiVersion: v2
name: postgresql name: postgresql
description: Helm Chart for postgresql description: Helm Chart for postgresql
type: application type: application
version: 1.4.0 version: 1.7.0
appVersion: "15" appVersion: "17"
...@@ -6,6 +6,10 @@ metadata: ...@@ -6,6 +6,10 @@ metadata:
{{- include "postgresql-helm.labels" . | nindent 4 }} {{- include "postgresql-helm.labels" . | nindent 4 }}
spec: spec:
replicas: {{ .Values.replicaCount }} replicas: {{ .Values.replicaCount }}
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: "100%"
serviceName: {{ include "postgresql-helm.fullname" . }} serviceName: {{ include "postgresql-helm.fullname" . }}
selector: selector:
matchLabels: matchLabels:
...@@ -41,6 +45,40 @@ spec: ...@@ -41,6 +45,40 @@ spec:
- emptyDir: - emptyDir:
medium: Memory medium: Memory
name: shm 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: containers:
- name: postgresql - name: postgresql
securityContext: securityContext:
......
...@@ -5,6 +5,12 @@ image: ...@@ -5,6 +5,12 @@ image:
pullPolicy: IfNotPresent pullPolicy: IfNotPresent
tag: "" tag: ""
updater:
enabled: false
repository: pgautoupgrade/pgautoupgrade
pullPolicy: IfNotPresent
tag: ""
imagePullSecrets: [ ] imagePullSecrets: [ ]
nameOverride: "" nameOverride: ""
fullnameOverride: "" fullnameOverride: ""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment