Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid upgrade being killed by failed liveness probes #344

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/nextcloud/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: nextcloud
version: 5.4.0
version: 6.0.0
appVersion: 29.0.4
description: A file sharing server that puts the control and security of your own data back into your hands.
keywords:
Expand Down
1 change: 0 additions & 1 deletion charts/nextcloud/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,6 @@ The following table lists the configurable parameters of the nextcloud chart and
| `nextcloud.existingSecret.smtpUsernameKey` | Name of the key that contains the SMTP username | `nil` |
| `nextcloud.existingSecret.smtpPasswordKey` | Name of the key that contains the SMTP password | `nil` |
| `nextcloud.existingSecret.smtpHostKey` | Name of the key that contains the SMTP hostname | `nil` |
| `nextcloud.update` | Trigger update if custom command is used | `0` |
| `nextcloud.containerPort` | Customize container port when not running as root | `80` |
| `nextcloud.trustedDomains` | Optional space-separated list of trusted domains | `[]` |
| `nextcloud.datadir` | nextcloud data dir location | `/var/www/html/data` |
Expand Down
4 changes: 0 additions & 4 deletions charts/nextcloud/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,6 @@ Create environment variables used to configure the nextcloud container as well a
{{- else }}
value: {{ .Values.nextcloud.host }}{{ if .Values.metrics.enabled }} {{ template "nextcloud.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local{{ end }}
{{- end }}
{{- if ne (int .Values.nextcloud.update) 0 }}
- name: NEXTCLOUD_UPDATE
value: {{ .Values.nextcloud.update | quote }}
{{- end }}
- name: NEXTCLOUD_DATA_DIR
value: {{ .Values.nextcloud.datadir | quote }}
{{- if .Values.nextcloud.mail.enabled }}
Expand Down
37 changes: 27 additions & 10 deletions charts/nextcloud/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ spec:
{{- end }}
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
{{- range $hook, $shell := .Values.nextcloud.hooks }}
{{- if $shell }}
- name: nextcloud-hooks
mountPath: /docker-entrypoint-hooks.d/{{ $hook }}/helm.sh
subPath: {{ $hook }}.sh
readOnly: true
{{- end }}
{{- end }}
{{- if .Values.nginx.enabled }}
- name: {{ .Chart.Name }}-nginx
image: "{{ .Values.nginx.image.repository }}:{{ .Values.nginx.image.tag }}"
Expand Down Expand Up @@ -287,7 +279,6 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if or .Values.nextcloud.extraInitContainers .Values.mariadb.enabled .Values.postgresql.enabled }}
initContainers:
{{- with .Values.nextcloud.extraInitContainers }}
{{- toYaml . | nindent 8 }}
Expand Down Expand Up @@ -334,7 +325,33 @@ spec:
- "-c"
- "until pg_isready -h ${POSTGRES_HOST} -U ${POSTGRES_USER} ; do sleep 2 ; done"
{{- end }}{{/* end-if any database-initContainer */}}
{{- end }}{{/* end-if any initContainer */}}
- 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" . | nindent 12 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
{{- with .Values.nextcloud.securityContext }}
securityContext:
{{- toYaml . | nindent 12 }}
{{- end }}
volumeMounts:
{{- include "nextcloud.volumeMounts" . | trim | nindent 12 }}
{{- range $hook, $shell := .Values.nextcloud.hooks }}
{{- if $shell }}
- name: nextcloud-hooks
mountPath: /docker-entrypoint-hooks.d/{{ $hook }}/helm.sh
subPath: {{ $hook }}.sh
readOnly: true
{{- end }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
Expand Down