From c54e98b60f1c6ebb8561bb0d1a76b7cb5b5890b0 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Fri, 27 Jan 2023 11:48:00 -0500 Subject: [PATCH 1/3] Remove nextcloud.update from values This should not have been exposed. There is no way to use it, since you can't pass a custom command to the container. Signed-off-by: Remi Rampin --- charts/nextcloud/README.md | 1 - charts/nextcloud/templates/_helpers.tpl | 4 ---- 2 files changed, 5 deletions(-) diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index e31284f1..9eb3ef1a 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -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` | diff --git a/charts/nextcloud/templates/_helpers.tpl b/charts/nextcloud/templates/_helpers.tpl index b0bf7355..3f6161c7 100644 --- a/charts/nextcloud/templates/_helpers.tpl +++ b/charts/nextcloud/templates/_helpers.tpl @@ -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 }} From affaea290d019c429b5e799a9651cd9f4640d77f Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Fri, 27 Jan 2023 11:38:07 -0500 Subject: [PATCH 2/3] Add an init container to do the upgrade Signed-off-by: Remi Rampin --- charts/nextcloud/templates/deployment.yaml | 37 ++++++++++++++++------ 1 file changed, 27 insertions(+), 10 deletions(-) diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 6f601963..bf2ceb8a 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -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 }}" @@ -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 }} @@ -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 }} From 394837008fb6d46406ae30b427db05cd006701e7 Mon Sep 17 00:00:00 2001 From: Remi Rampin Date: Mon, 22 Jul 2024 10:54:03 -0400 Subject: [PATCH 3/3] Major bump to chart version: 6.0.0 Signed-off-by: Remi Rampin --- charts/nextcloud/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index ec72c02c..50a3f61d 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -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: