diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 2140a97e..7239ae3e 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -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 }} @@ -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 }}