From a85391d0ae5fdef800d300109d18bc1de23cc31e Mon Sep 17 00:00:00 2001 From: Kjeld Schouten-Lebbing Date: Fri, 2 Jul 2021 23:59:17 +0200 Subject: [PATCH] Misc fixes (#647) --- charts/develop/nextcloud/Chart.yaml | 2 +- charts/develop/nextcloud/SCALE/ix_values.yaml | 54 ++++++++++++--- .../nextcloud/templates/_configmap.tpl | 1 + .../develop/nextcloud/templates/_cronjob.tpl | 2 +- .../develop/nextcloud/templates/_secrets.tpl | 1 + charts/develop/nextcloud/values.yaml | 69 ++++++++++++++----- 6 files changed, 103 insertions(+), 26 deletions(-) diff --git a/charts/develop/nextcloud/Chart.yaml b/charts/develop/nextcloud/Chart.yaml index e2850e57fab..88e986ef942 100644 --- a/charts/develop/nextcloud/Chart.yaml +++ b/charts/develop/nextcloud/Chart.yaml @@ -35,4 +35,4 @@ sources: - https://github.com/nextcloud/docker - https://github.com/nextcloud/helm type: application -version: 1.0.3 +version: 1.0.5 diff --git a/charts/develop/nextcloud/SCALE/ix_values.yaml b/charts/develop/nextcloud/SCALE/ix_values.yaml index b040e532bdf..b30c6c82370 100644 --- a/charts/develop/nextcloud/SCALE/ix_values.yaml +++ b/charts/develop/nextcloud/SCALE/ix_values.yaml @@ -19,12 +19,10 @@ envTpl: POSTGRES_DB: "{{ .Values.postgresql.postgresqlDatabase }}" POSTGRES_USER: "{{ .Values.postgresql.postgresqlUsername }}" - envFrom: - configMapRef: name: nextcloudconfig - envValueFrom: POSTGRES_PASSWORD: secretKeyRef: @@ -43,14 +41,54 @@ envValueFrom: name: rediscreds key: redis-password +initContainers: + - name: init-postgresdb + image: postgres:13.1 + command: + - "sh" + - "-c" + - "until pg_isready -h ${pghost} ; do sleep 2 ; done" + imagePullPolicy: IfNotPresent + env: + - name: pghost + valueFrom: + secretKeyRef: + name: dbcreds + key: plainhost + +# -- Probe configuration +# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) +# @default -- See below probes: + # -- Liveness probe configuration + # @default -- See below + liveness: + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php + + # -- Redainess probe configuration + # @default -- See below + readiness: + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php + + # -- Startup probe configuration + # @default -- See below startup: - spec: - initialDelaySeconds: 3 - timeoutSeconds: 2 - ## This means it has a maximum of 10*60=600 seconds to start up before it fails - periodSeconds: 10 - failureThreshold: 60 + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php ## Cronjob to execute Nextcloud background tasks ## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron diff --git a/charts/develop/nextcloud/templates/_configmap.tpl b/charts/develop/nextcloud/templates/_configmap.tpl index b73c5a77f74..c89bdb3f13b 100644 --- a/charts/develop/nextcloud/templates/_configmap.tpl +++ b/charts/develop/nextcloud/templates/_configmap.tpl @@ -18,4 +18,5 @@ metadata: name: nextcloudconfig data: NEXTCLOUD_TRUSTED_DOMAINS: {{ $hosts | quote }} + {{- end -}} diff --git a/charts/develop/nextcloud/templates/_cronjob.tpl b/charts/develop/nextcloud/templates/_cronjob.tpl index c7c95afb852..d465f4d4ced 100644 --- a/charts/develop/nextcloud/templates/_cronjob.tpl +++ b/charts/develop/nextcloud/templates/_cronjob.tpl @@ -3,7 +3,7 @@ {{- $jobName := include "common.names.fullname" . -}} --- -apiVersion: batch/v1 +apiVersion: batch/v1beta1 kind: CronJob metadata: name: {{ printf "%s-cronjob" $jobName }} diff --git a/charts/develop/nextcloud/templates/_secrets.tpl b/charts/develop/nextcloud/templates/_secrets.tpl index ef43adcd45a..d9ae0df858c 100644 --- a/charts/develop/nextcloud/templates/_secrets.tpl +++ b/charts/develop/nextcloud/templates/_secrets.tpl @@ -23,6 +23,7 @@ data: {{- end }} url: {{ ( printf "%v%v:%v@%v-%v:%v/%v" "postgresql://" .Values.postgresql.postgresqlUsername $dbPass .Release.Name "postgresql" "5432" .Values.postgresql.postgresqlDatabase ) | b64enc | quote }} host: {{ ( printf "%v-%v:5432" .Release.Name "postgresql" ) | b64enc | quote }} + plainhost: {{ ( printf "%v-%v" .Release.Name "postgresql" ) | b64enc | quote }} type: Opaque --- diff --git a/charts/develop/nextcloud/values.yaml b/charts/develop/nextcloud/values.yaml index b45a78db9a8..a60ec6640fc 100644 --- a/charts/develop/nextcloud/values.yaml +++ b/charts/develop/nextcloud/values.yaml @@ -34,14 +34,14 @@ envValueFrom: secretKeyRef: name: dbcreds key: host - # REDIS_HOST: - # secretKeyRef: - # name: rediscreds - # key: masterhost - # REDIS_PASSWORD: - # secretKeyRef: - # name: rediscreds - # key: redis-password + REDIS_HOST: + secretKeyRef: + name: rediscreds + key: masterhost + REDIS_PASSWORD: + secretKeyRef: + name: rediscreds + key: redis-password persistence: data: @@ -63,20 +63,57 @@ persistence: enabled: true type: emptyDir +initContainers: + - name: init-postgresdb + image: postgres:13.1 + command: + - "sh" + - "-c" + - "until pg_isready -h ${pghost} ; do sleep 2 ; done" + imagePullPolicy: IfNotPresent + env: + - name: pghost + valueFrom: + secretKeyRef: + name: dbcreds + key: plainhost podSecurityContext: fsGroup: 33 -# test +# -- Probe configuration +# -- [[ref]](https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-startup-probes/) +# @default -- See below probes: - startup: - spec: - initialDelaySeconds: 3 - timeoutSeconds: 2 - ## This means it has a maximum of 10*60=600 seconds to start up before it fails - periodSeconds: 10 - failureThreshold: 60 + # -- Liveness probe configuration + # @default -- See below + liveness: + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php + # -- Redainess probe configuration + # @default -- See below + readiness: + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php + + # -- Startup probe configuration + # @default -- See below + startup: + # -- sets the probe type when not using a custom probe + # @default -- "TCP" + type: HTTP + # -- If a HTTP probe is used (default for HTTP/HTTPS services) this path is used + # @default -- "/" + path: /status.php ## Cronjob to execute Nextcloud background tasks ## ref: https://docs.nextcloud.com/server/latest/admin_manual/configuration_server/background_jobs_configuration.html#webcron