From 33dcd42757e458a8ef1b97aa0a49e2d6b580ab29 Mon Sep 17 00:00:00 2001 From: Taylor Vories Date: Mon, 28 Dec 2020 08:06:24 -0700 Subject: [PATCH 1/5] Set redis default password and ENV REDIS_HOST_PASSWORD (#54) * fix helm stable repo (#40) This is related to https://helm.sh/blog/new-location-stable-incubator-charts/ Signed-off-by: Jeff Billimek Signed-off-by: Taylor * Adding redis password to env vars Signed-off-by: Taylor * bumped chart version Signed-off-by: Taylor * Updated Readme with redis password changes Signed-off-by: Taylor Co-authored-by: Jeff Billimek --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 2 ++ charts/nextcloud/templates/deployment.yaml | 2 ++ charts/nextcloud/values.yaml | 1 + 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index a7230639..f09387b5 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 2.3.2 +version: 2.3.3 appVersion: 19.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 6520e833..d479a038 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -114,6 +114,8 @@ The following table lists the configurable parameters of the nextcloud chart and | `mariadb.db.user` | Database user to create | `nextcloud` | | `mariadb.rootUser.password` | MariaDB admin password | `nil` | | `redis.enabled` | Whether to install/use redis for locking | `false` | +| `redis.usePassword` | Whether to use a password with redis | `false` | +| `redis.password` | The password redis uses | `''` | | `cronjob.enabled` | Whether to enable/disable cronjob | `false` | | `cronjob.schedule` | Schedule for the CronJob | `*/15 * * * *` | | `cronjob.annotations` | Annotations to add to the cronjob | {} | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index fad0d7a3..65b646bf 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -163,6 +163,8 @@ spec: value: {{ template "nextcloud.redis.fullname" . }}-master - name: REDIS_HOST_PORT value: {{ .Values.redis.redisPort | quote }} + - name: REDIS_HOST_PASSWORD + value: {{ .Values.redis.password }} {{- end }} {{- if .Values.nextcloud.extraEnv }} {{ toYaml .Values.nextcloud.extraEnv | indent 8 }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 546238ca..73a2d3c8 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -243,6 +243,7 @@ postgresql: redis: enabled: false usePassword: false + password: '' ## Cronjob to execute Nextcloud background tasks ## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron From c4caa176f623d5abb458d21730f5092b21911a7b Mon Sep 17 00:00:00 2001 From: Michel Zimmer Date: Mon, 28 Dec 2020 16:12:46 +0100 Subject: [PATCH 2/5] Add option for a custom secret (#47) Introducing options nested under `nextcloud.existingSecret` to allow for a deployment that does not contain the secret and instead uses an existing secret. Signed-off-by: Michel Zimmer Co-authored-by: Jeff Billimek --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 4 ++++ charts/nextcloud/templates/deployment.yaml | 8 ++++---- charts/nextcloud/templates/secrets.yaml | 2 ++ charts/nextcloud/values.yaml | 6 ++++++ 5 files changed, 17 insertions(+), 5 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index f09387b5..87d90104 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 2.3.3 +version: 2.4.0 appVersion: 19.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index d479a038..7ae8f994 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -61,6 +61,10 @@ The following table lists the configurable parameters of the nextcloud chart and | `nextcloud.host` | nextcloud host to create application URLs | `nextcloud.kube.home` | | `nextcloud.username` | User of the application | `admin` | | `nextcloud.password` | Application password | `changeme` | +| `nextcloud.existingSecret.enabled` | Whether to use an existing secret or not | `false` | +| `nextcloud.existingSecret.secretName` | Name of the existing secret | `nil` | +| `nextcloud.existingSecret.usernameKey` | Name of the key that contains the username | `nil` | +| `nextcloud.existingSecret.passwordKey` | Name of the key that contains the password | `nil` | | `nextcloud.update` | Trigger update if custom command is used | `0` | | `nextcloud.datadir` | nextcloud data dir location | `/var/www/html/data` | | `nextcloud.tableprefix` | nextcloud db table prefix | `''` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 65b646bf..87ece66d 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -115,13 +115,13 @@ spec: - name: NEXTCLOUD_ADMIN_USER valueFrom: secretKeyRef: - name: {{ template "nextcloud.fullname" . }} - key: nextcloud-username + name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }} + key: {{ .Values.nextcloud.existingSecret.usernameKey | default "nextcloud-username" }} - name: NEXTCLOUD_ADMIN_PASSWORD valueFrom: secretKeyRef: - name: {{ template "nextcloud.fullname" . }} - key: nextcloud-password + name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }} + key: {{ .Values.nextcloud.existingSecret.passwordKey | default "nextcloud-password" }} - name: NEXTCLOUD_TRUSTED_DOMAINS value: {{ .Values.nextcloud.host }} {{- if ne (int .Values.nextcloud.update) 0 }} diff --git a/charts/nextcloud/templates/secrets.yaml b/charts/nextcloud/templates/secrets.yaml index 8473eba0..a831b0c3 100644 --- a/charts/nextcloud/templates/secrets.yaml +++ b/charts/nextcloud/templates/secrets.yaml @@ -1,3 +1,4 @@ +{{- if not .Values.nextcloud.existingSecret.enabled }} apiVersion: v1 kind: Secret metadata: @@ -19,3 +20,4 @@ data: smtp-username: {{ default "" .Values.nextcloud.mail.smtp.name | b64enc | quote }} smtp-password: {{ default "" .Values.nextcloud.mail.smtp.password | b64enc | quote }} {{- end }} +{{- end }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 73a2d3c8..336b1a0f 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -64,6 +64,12 @@ nextcloud: host: nextcloud.kube.home username: admin password: changeme + ## Use an existing secret + existingSecret: + enabled: false + # secretName: nameofsecret + # usernameKey: username + # passwordKey: password update: 0 datadir: /var/www/html/data tableprefix: From 24f9373984cfc1970778229a4fcc4e08b335415e Mon Sep 17 00:00:00 2001 From: Fabian Lober Date: Mon, 28 Dec 2020 16:17:49 +0100 Subject: [PATCH 3/5] Add StartupProbe (#27) Signed-off-by: Fabian Lober Co-authored-by: Fabian Lober Co-authored-by: Jeff Billimek --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 14 ++++++++++---- charts/nextcloud/templates/deployment.yaml | 15 +++++++++++++++ charts/nextcloud/values.yaml | 16 ++++++++++++---- 4 files changed, 38 insertions(+), 9 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 87d90104..7fb726af 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 2.4.0 +version: 2.5.0 appVersion: 19.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 7ae8f994..848ffbfd 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -141,17 +141,23 @@ The following table lists the configurable parameters of the nextcloud chart and | `persistence.size` | PVC Storage Request for nextcloud volume | `8Gi` | | `resources` | CPU/Memory resource requests/limits | `{}` | | `livenessProbe.enabled` | Turn on and off liveness probe | `true` | -| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `30` | -| `livenessProbe.periodSeconds` | How often to perform the probe | `15` | +| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | `10` | +| `livenessProbe.periodSeconds` | How often to perform the probe | `10` | | `livenessProbe.timeoutSeconds` | When the probe times out | `5` | | `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe | `3` | | `livenessProbe.successThreshold` | Minimum consecutive successes for the probe | `1` | | `readinessProbe.enabled` | Turn on and off readiness probe | `true` | -| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` | -| `readinessProbe.periodSeconds` | How often to perform the probe | `15` | +| `readinessProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `10` | +| `readinessProbe.periodSeconds` | How often to perform the probe | `10` | | `readinessProbe.timeoutSeconds` | When the probe times out | `5` | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe | `3` | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe | `1` | +| `startupProbe.enabled` | Turn on and off startup probe | `false` | +| `startupProbe.initialDelaySeconds` | Delay before readiness probe is initiated | `30` | +| `startupProbe.periodSeconds` | How often to perform the probe | `10` | +| `startupProbe.timeoutSeconds` | When the probe times out | `5` | +| `startupProbe.failureThreshold` | Minimum consecutive failures for the probe | `30` | +| `startupProbe.successThreshold` | Minimum consecutive successes for the probe | `1` | | `hpa.enabled` | Boolean to create a HorizontalPodAutoscaler | `false` | | `hpa.cputhreshold` | CPU threshold percent for the HorizontalPodAutoscale | `60` | | `hpa.minPods` | Min. pods for the Nextcloud HorizontalPodAutoscaler | `1` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 87ece66d..6f9dd243 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -203,6 +203,20 @@ spec: successThreshold: {{ .Values.readinessProbe.successThreshold }} failureThreshold: {{ .Values.readinessProbe.failureThreshold }} {{- end }} + {{- if .Values.startupProbe.enabled }} + startupProbe: + httpGet: + path: /status.php + port: http + httpHeaders: + - name: Host + value: {{ .Values.nextcloud.host | quote }} + initialDelaySeconds: {{ .Values.startupProbe.initialDelaySeconds }} + periodSeconds: {{ .Values.startupProbe.periodSeconds }} + timeoutSeconds: {{ .Values.startupProbe.timeoutSeconds }} + successThreshold: {{ .Values.startupProbe.successThreshold }} + failureThreshold: {{ .Values.startupProbe.failureThreshold }} + {{- end }} resources: {{ toYaml .Values.resources | indent 10 }} volumeMounts: @@ -285,6 +299,7 @@ spec: successThreshold: {{ .Values.readinessProbe.successThreshold }} failureThreshold: {{ .Values.readinessProbe.failureThreshold }} {{- end }} + resources: {{ toYaml .Values.nginx.resources | indent 10 }} volumeMounts: diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 336b1a0f..a3727d24 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -341,18 +341,26 @@ resources: {} ## livenessProbe: enabled: true - initialDelaySeconds: 30 - periodSeconds: 15 + initialDelaySeconds: 10 + periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 readinessProbe: enabled: true - initialDelaySeconds: 30 - periodSeconds: 15 + initialDelaySeconds: 10 + periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 successThreshold: 1 +startupProbe: + enabled: false + initialDelaySeconds: 30 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 30 + successThreshold: 1 + ## Enable pod autoscaling using HorizontalPodAutoscaler ## ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/ From 9a00db59b84b7ac239e7d774bca6f6916abc8b5b Mon Sep 17 00:00:00 2001 From: Dan <1676208+maxirus@users.noreply.github.com> Date: Sat, 30 Jan 2021 18:01:18 -0500 Subject: [PATCH 4/5] Fixes #64 (#65) * Fixes #64 Signed-off-by: Max <1676208+maxirus@users.noreply.github.com> * Adding Docs Signed-off-by: Max <1676208+maxirus@users.noreply.github.com> --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/README.md | 2 ++ charts/nextcloud/templates/deployment.yaml | 8 ++++---- charts/nextcloud/values.yaml | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index 7fb726af..cd03a53c 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 2.5.0 +version: 2.5.1 appVersion: 19.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/README.md b/charts/nextcloud/README.md index 848ffbfd..1ec07cd6 100644 --- a/charts/nextcloud/README.md +++ b/charts/nextcloud/README.md @@ -65,6 +65,8 @@ The following table lists the configurable parameters of the nextcloud chart and | `nextcloud.existingSecret.secretName` | Name of the existing secret | `nil` | | `nextcloud.existingSecret.usernameKey` | Name of the key that contains the username | `nil` | | `nextcloud.existingSecret.passwordKey` | Name of the key that contains the password | `nil` | +| `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.update` | Trigger update if custom command is used | `0` | | `nextcloud.datadir` | nextcloud data dir location | `/var/www/html/data` | | `nextcloud.tableprefix` | nextcloud db table prefix | `''` | diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 6f9dd243..434e4a0e 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -150,13 +150,13 @@ spec: - name: SMTP_NAME valueFrom: secretKeyRef: - name: {{ template "nextcloud.fullname" . }} - key: smtp-username + name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }} + key: {{ .Values.nextcloud.existingSecret.smtpUsernameKey | default "smtp-username" }} - name: SMTP_PASSWORD valueFrom: secretKeyRef: - name: {{ template "nextcloud.fullname" . }} - key: smtp-password + name: {{ .Values.nextcloud.existingSecret.secretName | default (include "nextcloud.fullname" .) }} + key: {{ .Values.nextcloud.existingSecret.smtpPasswordKey | default "smtp-password" }} {{- end }} {{- if .Values.redis.enabled }} - name: REDIS_HOST diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index a3727d24..8403a017 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -70,6 +70,8 @@ nextcloud: # secretName: nameofsecret # usernameKey: username # passwordKey: password + # smtpUsernameKey: smtp_username + # smtpPasswordKey: smtp_password update: 0 datadir: /var/www/html/data tableprefix: From 0913ce2f362dbd967cb553146191314f57b9eac9 Mon Sep 17 00:00:00 2001 From: Aitor Date: Fri, 5 Feb 2021 17:55:58 +0000 Subject: [PATCH 5/5] fixes nextcloud/helm#70 saving phpConfigs files to the right directory when using fpm (#71) * fixes nextcloud/helm#70 saving phpConfigs files to the right directory when using fpm - When using nginx + nextcloud fpm image, `phpConfigs` are now mounted to /usr/local/etc/php-fpm.d instead of /usr/local/etc/php/conf.d Signed-off-by: Aitor Pazos * fixes nextcloud/helm#70 Bump version Signed-off-by: Aitor Pazos --- charts/nextcloud/Chart.yaml | 2 +- charts/nextcloud/templates/deployment.yaml | 3 ++- charts/nextcloud/values.yaml | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/charts/nextcloud/Chart.yaml b/charts/nextcloud/Chart.yaml index cd03a53c..884417f5 100644 --- a/charts/nextcloud/Chart.yaml +++ b/charts/nextcloud/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: nextcloud -version: 2.5.1 +version: 2.5.2 appVersion: 19.0.3 description: A file sharing server that puts the control and security of your own data back into your hands. keywords: diff --git a/charts/nextcloud/templates/deployment.yaml b/charts/nextcloud/templates/deployment.yaml index 434e4a0e..53b99bc5 100644 --- a/charts/nextcloud/templates/deployment.yaml +++ b/charts/nextcloud/templates/deployment.yaml @@ -255,9 +255,10 @@ spec: {{- end }} {{- end }} {{- end }} + {{- $nginxEnabled := .Values.nginx.enabled -}} {{- range $key, $value := .Values.nextcloud.phpConfigs }} - name: nextcloud-phpconfig - mountPath: /usr/local/etc/php/conf.d/{{ $key }} + mountPath: {{ $nginxEnabled | ternary (printf "/usr/local/etc/php-fpm.d/%s" $key | quote) (printf "/usr/local/etc/php/conf.d/%s" $key | quote) }} subPath: {{ $key }} {{- end }} {{- if .Values.nextcloud.extraVolumeMounts }} diff --git a/charts/nextcloud/values.yaml b/charts/nextcloud/values.yaml index 8403a017..5d155bae 100644 --- a/charts/nextcloud/values.yaml +++ b/charts/nextcloud/values.yaml @@ -89,7 +89,7 @@ nextcloud: name: user password: pass # PHP Configuration files - # Will be injected in /usr/local/etc/php/conf.d + # Will be injected in /usr/local/etc/php/conf.d for apache image and in /usr/local/etc/php-fpm.d when nginx.enabled: true phpConfigs: {} # Default config files # IMPORTANT: Will be used only if you put extra configs, otherwise default will come from nextcloud itself