Skip to content

Commit

Permalink
Add an init container to do the upgrade
Browse files Browse the repository at this point in the history
Signed-off-by: Remi Rampin <[email protected]>
  • Loading branch information
remram44 committed Jan 27, 2023
1 parent 83691d9 commit 11f5cf8
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.nextcloud.extraInitContainers .Values.mariadb.enabled .Values.postgresql.enabled }}
initContainers:
{{- if .Values.nextcloud.extraInitContainers }}
{{- toYaml .Values.nextcloud.extraInitContainers | nindent 8 }}
Expand Down Expand Up @@ -286,7 +285,27 @@ spec:
- "-c"
- {{ printf "until pg_isready -h %s-postgresql -U ${POSTGRES_USER} ; do sleep 2 ; done" .Release.Name }}
{{- end }}
{{- end }}
- name: {{ .Chart.Name }}-upgrade
image: {{ include "nextcloud.image" . }}
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
# Do upgrade then exit
# This avoids doing it in the container, which could get killed by failed liveness probes
- "true"
env:
- name: NEXTCLOUD_UPDATE
value: "1"
{{- include "nextcloud.env" . | indent 8 }}
resources:
{{ toYaml .Values.resources | indent 10 }}
{{- if .Values.nextcloud.securityContext}}
securityContext:
{{- with .Values.nextcloud.securityContext }}
{{- toYaml . | nindent 10 }}
{{- end }}
{{- end }}
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 8 }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down

0 comments on commit 11f5cf8

Please sign in to comment.