From 15667f36a6b8da1ed14e811a99845cd225c9e21c Mon Sep 17 00:00:00 2001 From: Stavros Kois <47820033+stavros-k@users.noreply.github.com> Date: Fri, 6 Oct 2023 16:44:43 +0300 Subject: [PATCH] NAS-123919 / 24.04 / re-adds nextcloud chart with version 26 (#1548) * re-adds nextcloud chart with version 26 * add to_keep_versions --- charts/nextcloud/1.6.29/.helmignore | 21 ++ charts/nextcloud/1.6.29/Chart.lock | 6 + charts/nextcloud/1.6.29/Chart.yaml | 30 ++ charts/nextcloud/1.6.29/README.md | 11 + charts/nextcloud/1.6.29/app-readme.md | 3 + .../1.6.29/charts/common-2304.0.1.tgz | Bin 0 -> 4993 bytes charts/nextcloud/1.6.29/ci/test-values.yaml | 36 ++ charts/nextcloud/1.6.29/ix_values.yaml | 10 + charts/nextcloud/1.6.29/metadata.yaml | 46 +++ .../1.6.29/migrations/migrate_from_1.1.0 | 26 ++ charts/nextcloud/1.6.29/questions.yaml | 356 ++++++++++++++++++ charts/nextcloud/1.6.29/templates/NOTES.txt | 3 + charts/nextcloud/1.6.29/templates/_nginx.tpl | 79 ++++ .../nextcloud/1.6.29/templates/_postgres.tpl | 49 +++ .../templates/backup-postgres-config.yaml | 15 + .../templates/backup-postgres-hook.yaml | 39 ++ .../nextcloud/1.6.29/templates/cronjob.yaml | 49 +++ .../1.6.29/templates/deployment.yaml | 202 ++++++++++ .../1.6.29/templates/nginx-configmap.yaml | 67 ++++ .../1.6.29/templates/nginx-secret.yaml | 10 + .../templates/nuke-deployments-hook.yaml | 24 ++ .../1.6.29/templates/postgres-deployment.yaml | 50 +++ .../1.6.29/templates/postgres-secret.yaml | 22 ++ .../1.6.29/templates/postgres-service.yaml | 6 + .../nextcloud/1.6.29/templates/secrets.yaml | 13 + .../nextcloud/1.6.29/templates/service.yaml | 10 + .../1.6.29/templates/serviceaccount.yaml | 35 ++ .../charts/nextcloud/to_keep_versions.yaml | 1 + 28 files changed, 1219 insertions(+) create mode 100644 charts/nextcloud/1.6.29/.helmignore create mode 100644 charts/nextcloud/1.6.29/Chart.lock create mode 100644 charts/nextcloud/1.6.29/Chart.yaml create mode 100644 charts/nextcloud/1.6.29/README.md create mode 100644 charts/nextcloud/1.6.29/app-readme.md create mode 100644 charts/nextcloud/1.6.29/charts/common-2304.0.1.tgz create mode 100644 charts/nextcloud/1.6.29/ci/test-values.yaml create mode 100644 charts/nextcloud/1.6.29/ix_values.yaml create mode 100644 charts/nextcloud/1.6.29/metadata.yaml create mode 100755 charts/nextcloud/1.6.29/migrations/migrate_from_1.1.0 create mode 100644 charts/nextcloud/1.6.29/questions.yaml create mode 100644 charts/nextcloud/1.6.29/templates/NOTES.txt create mode 100644 charts/nextcloud/1.6.29/templates/_nginx.tpl create mode 100644 charts/nextcloud/1.6.29/templates/_postgres.tpl create mode 100644 charts/nextcloud/1.6.29/templates/backup-postgres-config.yaml create mode 100644 charts/nextcloud/1.6.29/templates/backup-postgres-hook.yaml create mode 100644 charts/nextcloud/1.6.29/templates/cronjob.yaml create mode 100644 charts/nextcloud/1.6.29/templates/deployment.yaml create mode 100644 charts/nextcloud/1.6.29/templates/nginx-configmap.yaml create mode 100644 charts/nextcloud/1.6.29/templates/nginx-secret.yaml create mode 100644 charts/nextcloud/1.6.29/templates/nuke-deployments-hook.yaml create mode 100644 charts/nextcloud/1.6.29/templates/postgres-deployment.yaml create mode 100644 charts/nextcloud/1.6.29/templates/postgres-secret.yaml create mode 100644 charts/nextcloud/1.6.29/templates/postgres-service.yaml create mode 100644 charts/nextcloud/1.6.29/templates/secrets.yaml create mode 100644 charts/nextcloud/1.6.29/templates/service.yaml create mode 100644 charts/nextcloud/1.6.29/templates/serviceaccount.yaml create mode 100644 library/ix-dev/charts/nextcloud/to_keep_versions.yaml diff --git a/charts/nextcloud/1.6.29/.helmignore b/charts/nextcloud/1.6.29/.helmignore new file mode 100644 index 0000000000..f0c1319444 --- /dev/null +++ b/charts/nextcloud/1.6.29/.helmignore @@ -0,0 +1,21 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*~ +# Various IDEs +.project +.idea/ +*.tmproj diff --git a/charts/nextcloud/1.6.29/Chart.lock b/charts/nextcloud/1.6.29/Chart.lock new file mode 100644 index 0000000000..2cf39f5f09 --- /dev/null +++ b/charts/nextcloud/1.6.29/Chart.lock @@ -0,0 +1,6 @@ +dependencies: +- name: common + repository: file://../../../common/2304.0.1 + version: 2304.0.1 +digest: sha256:1ed155c6760e1166e2cb75b52bc5e81c6bdf0252c16ff5ede001157077c41670 +generated: "2023-04-24T13:40:41.468936547+03:00" diff --git a/charts/nextcloud/1.6.29/Chart.yaml b/charts/nextcloud/1.6.29/Chart.yaml new file mode 100644 index 0000000000..fea44c9895 --- /dev/null +++ b/charts/nextcloud/1.6.29/Chart.yaml @@ -0,0 +1,30 @@ +name: nextcloud +description: A file sharing server that puts the control and security of your own + data back into your hands. +annotations: + title: Nextcloud +type: application +version: 1.6.29 +apiVersion: v2 +appVersion: 26.0.2 +kubeVersion: '>=1.16.0-0' +maintainers: + - name: truenas + url: https://www.truenas.com/ + email: dev@ixsystems.com +dependencies: + - name: common + repository: file://../../../common/2304.0.1 + version: 2304.0.1 +home: https://nextcloud.com/ +icon: https://cdn.rawgit.com/docker-library/docs/defa5ffc7123177acd60ddef6e16bddf694cc35f/nextcloud/logo.svg +sources: + - https://github.com/nextcloud/docker + - https://github.com/nextcloud/helm + - https://github.com/truenas/charts/tree/master/library/ix-dev/charts/nextcloud +keywords: + - nextcloud + - storage + - http + - web + - php diff --git a/charts/nextcloud/1.6.29/README.md b/charts/nextcloud/1.6.29/README.md new file mode 100644 index 0000000000..28f3c66405 --- /dev/null +++ b/charts/nextcloud/1.6.29/README.md @@ -0,0 +1,11 @@ +# nextcloud + +[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands. + +## Introduction + +This chart bootstraps an [nextcloud](https://hub.docker.com/_/nextcloud/) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager. + +## Configuration + +Please refer to questions.yaml for a detailed overview on supported configurable values. diff --git a/charts/nextcloud/1.6.29/app-readme.md b/charts/nextcloud/1.6.29/app-readme.md new file mode 100644 index 0000000000..f2e78c31f9 --- /dev/null +++ b/charts/nextcloud/1.6.29/app-readme.md @@ -0,0 +1,3 @@ +# nextcloud + +[nextcloud](https://nextcloud.com/) is a file sharing server that puts the control and security of your own data back into your hands. diff --git a/charts/nextcloud/1.6.29/charts/common-2304.0.1.tgz b/charts/nextcloud/1.6.29/charts/common-2304.0.1.tgz new file mode 100644 index 0000000000000000000000000000000000000000..217c5d97c60cf2ae6caeb2d7c8d8ee30fdfbaeb8 GIT binary patch literal 4993 zcmV-{6MpO;iwG0|00000|0w_~VMtOiV@ORlOnEsqVl!4SWK%V1T2nbTPgYhoO;>Dc zVQyr3R8em|NM&qo0PH<$bKAC-{j6VcmPzMY*_wJ-ws$CeGyE&d!bt zk&uL%1Q-C6qfNcPeFrZReCT02R+3iuV2k9z!2xhyJU9R&mZpsM&Sr?qaDmd~yU$C!nQKav>4_uK(z^>Ye*W z3d+cP%mrce1m?pI%Chou(222#ILV~GK81vgIpPb56t}>HaUlPK*OLi}2uk1#NtCc@ zhoTgpfMKkTTx9sfRqV_i?%_dy6!ybG=S%nhuU@SDOPpp2l34Vv1?F=SVH8Cyr!th; zqgBE>`5zq*YVv-a)9_-Y2Ui9wnI-fr6LyRYcVh9YggjEg+ zVE^u}Q_&-X&JCgQ30xV#Q;RRf62(ZOlMaAU5}!T+p;3~@C35vZxF&4POO)aOLihtd z@6h|KVsjs>}c3U?=}uDO&#D&4>WU0$L4V0Z0IX zagyVV6KbqIN)jj2z{bDhND7cMBmr>@5ywd4xN}S7j8Kp>Y<&P{{lldS#qyk!`k)ZD z=W~?gSis4T5E@w5d;wwWD6v;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agXH*~sY+E!0NEAr-a zY;EY>TSsHm*M}EeyX^zMjM`e0!T@0Jc5T*TJ?f;RFb^xCA`wxesVRQe-?)>+y zlxl8L>G$b%Ci1ZmfH4v{21dcg7FH)KZ5B1C#k1BbnCD*L!o8@*!hQKqQMi!;DcAd+ zS0W`2SMd_OA+DD1<$ODDqgMXI8BS6%rHtdx-^N<`KRB#^|NH28cmC^E$}{z@A~C0W zq1SMLdf%Wh&PfszI)w~HH)x7Q*m(x}a6J1#KmlTglLV#-8=JjIgie0|juRxw92-4S z-bXaUKn6h*Hk1yhB+jJ;;<8*UtM2G#&PEv*wf12 zpIt#rxafpaB76F;A-@xj|CjglUw30R?WsTRQp{u{Qsw-;n?Q?)xv>DbL`Q{iy%hs*n1sdm5nAdGX?(r*AJWF8^@? z?|!KP;X*m)SNL(5EfyBe?kj zP&Cud7=kH7iK1kTRaeg6{u*{V&z`{rm7K-7PT8>oY7W1(nK{Dsy4Wl@!%2p@fZG{~ zW)LA-oa!tY#CVPqmI1}Lj;vg#8|evZOi9-n1TddP;NiER=XPaRc4b#~rCR /postgres_backups/$BACKUP_NAME; diff --git a/charts/nextcloud/1.6.29/templates/backup-postgres-hook.yaml b/charts/nextcloud/1.6.29/templates/backup-postgres-hook.yaml new file mode 100644 index 0000000000..175b0f2617 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/backup-postgres-hook.yaml @@ -0,0 +1,39 @@ +{{- if .Values.ixChartContext.isUpgrade -}} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} +apiVersion: batch/v1 +kind: Job +metadata: + name: "pre-upgrade-hook2" + annotations: + "helm.sh/hook": pre-upgrade + "helm.sh/hook-weight": "1" + "helm.sh/hook-delete-policy": hook-succeeded + rollme: {{ randAlphaNum 5 | quote }} +spec: + template: + metadata: + name: "pre-upgrade-hook2" + spec: + restartPolicy: Never + serviceAccountName: "{{ template "common.names.serviceAccountName" . }}" + containers: + - name: {{ .Chart.Name }}-postgres-backup + image: {{ template "postgres.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} + - name: BACKUP_NAME + value: {{ template "postgres.backupName" . }} + volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} + - name: backup-script-configmap + mountPath: /bin/backup_entrypoint.sh + readOnly: true + subPath: entrypoint.sh + command: + - "/bin/backup_entrypoint.sh" + volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} + - name: backup-script-configmap + configMap: + defaultMode: 0700 + name: "postgres-backup-hook-config-map" +{{- end -}} diff --git a/charts/nextcloud/1.6.29/templates/cronjob.yaml b/charts/nextcloud/1.6.29/templates/cronjob.yaml new file mode 100644 index 0000000000..2d3b650700 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/cronjob.yaml @@ -0,0 +1,49 @@ +{{ $cronjob_values := (. | mustDeepCopy) }} +{{ $_ := set $cronjob_values "common" (dict "nameSuffix" "cronjob") }} + +{{ $hostName := .Values.nextcloud.host }} +{{ if .Values.useServiceNameForHost }} +{{ $hostName = (include "common.names.fullname" .) }} +{{ end }} + +{{if .Values.cronjob.enabled }} +apiVersion: batch/v1 +kind: CronJob +metadata: + name: {{ template "common.names.fullname" $cronjob_values }} + labels: + app: {{ template "common.names.name" $cronjob_values }} + chart: {{ template "common.names.chart" $cronjob_values }} + release: {{ .Release.Name }} + annotations: + rollme: {{ randAlphaNum 5 | quote }} +spec: + schedule: "{{ .Values.cronjob.schedule }}" + concurrencyPolicy: Forbid + failedJobsHistoryLimit: 2 + successfulJobsHistoryLimit: 1 + jobTemplate: + metadata: + labels: + app: {{ template "common.names.name" $cronjob_values }} + release: {{ .Release.Name }} + {{- include "common.labels.selectorLabels" $cronjob_values | nindent 8 }} + spec: + template: + metadata: + labels: + app: {{ template "common.names.name" $cronjob_values }} + release: {{ .Release.Name }} + {{- include "common.labels.selectorLabels" $cronjob_values | nindent 12 }} + spec: + restartPolicy: Never + containers: + - name: {{ .Chart.Name }}-cronjob + image: "{{.Values.image.repository }}:{{.Values.image.tag }}" + imagePullPolicy: {{ .Values.image.pullPolicy }} + {{- if .Values.certificate }} + command: [ "curl" ,"-k" , "https://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"] + {{- else }} + command: [ "curl" , "http://{{ $hostName }}:{{.Values.service.nodePort}}/cron.php"] + {{- end }} +{{ end }} diff --git a/charts/nextcloud/1.6.29/templates/deployment.yaml b/charts/nextcloud/1.6.29/templates/deployment.yaml new file mode 100644 index 0000000000..fc88cd52e3 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/deployment.yaml @@ -0,0 +1,202 @@ +{{ include "common.storage.hostPathValidate" .Values }} +{{ $postgres_values := (. | mustDeepCopy) }} +{{ $_ := set $postgres_values "common" (dict "nameSuffix" "postgres") }} +{{ include "common.deployment.common_config" . | nindent 0 }} +spec: {{ include "common.deployment.common_spec" . | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" . | nindent 4 }} + spec: + initContainers: + - name: init-postgresdb + image: {{ template "postgres.imageName" . }} + command: ['sh', '-c', "until pg_isready -U $POSTGRES_USER -d {{ include "postgres.DatabaseName" .Values }} -h {{ template "common.names.fullname" $postgres_values }}; do echo waiting for postgres; sleep 2; done"] + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }} + + containers: + {{ if eq (include "nginx.certAvailable" .) "true" }} + - name: nginx + {{ include "common.containers.imageConfig" .Values.nginx.image | nindent 8 }} + volumeMounts: + - name: nginx-configuration + mountPath: /etc/nginx/nginx.conf + subPath: nginx.conf + {{ include "nginx.tlsKeysVolumeMount" . | nindent 10 }} + ports: + - name: nginx-http + containerPort: 8000 + protocol: TCP + - name: nginx-https + containerPort: 443 + protocol: TCP + livenessProbe: + httpGet: + scheme: HTTPS + path: /status.php + port: 443 + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + readinessProbe: + httpGet: + scheme: HTTPS + path: /status.php + port: 443 + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 2 + startupProbe: + httpGet: + scheme: HTTPS + path: /status.php + port: 443 + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 60 + successThreshold: 1 + {{ end }} + - name: {{ .Chart.Name }} + {{ include "common.resources.limitation" . | nindent 8 }} + {{ include "common.containers.imageConfig" .Values.image | nindent 8 }} + env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }} + {{ $secretName := (include "common.names.fullname" .) }} + {{ $envList := (default list .Values.environmentVariables) }} + {{ $envList = mustAppend $envList (dict "name" "POSTGRES_HOST" "value" (printf "%s:5432" (include "common.names.fullname" $postgres_values))) }} + {{ $envList = mustAppend $envList (dict "name" "POSTGRES_DB" "value" (include "postgres.DatabaseName" .)) }} + {{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_DATA_DIR" "value" .Values.nextcloud.datadir) }} + {{ if eq (include "nginx.certAvailable" .) "true" }} + {{ $envList = mustAppend $envList (dict "name" "APACHE_DISABLE_REWRITE_IP" "value" "1") }} + {{ if and .Values.nextcloud.host .Values.service.nodePort }} + {{ $envList = mustAppend $envList (dict "name" "OVERWRITEHOST" "value" (printf "%v:%v" .Values.nextcloud.host .Values.service.nodePort)) }} + {{ end }} + {{ $envList = mustAppend $envList (dict "name" "OVERWRITEPROTOCOL" "value" "https") }} + {{ $envList = mustAppend $envList (dict "name" "TRUSTED_PROXIES" "value" "127.0.0.1") }} + {{ end }} + {{ $hostName := .Values.nextcloud.host }} + {{ if .Values.useServiceNameForHost }} + {{ $hostName = (include "common.names.fullname" .) }} + {{ end }} + {{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_TRUSTED_DOMAINS" "value" $hostName) }} + {{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_USER" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-username") }} + {{ $envList = mustAppend $envList (dict "name" "NEXTCLOUD_ADMIN_PASSWORD" "valueFromSecret" true "secretName" $secretName "secretKey" "nextcloud-password") }} + {{ include "common.containers.environmentVariables" (dict "environmentVariables" $envList) | nindent 10 }} + ports: + - name: http + containerPort: 80 + protocol: TCP + livenessProbe: + httpGet: + path: /status.php + port: http + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + readinessProbe: + httpGet: + path: /status.php + port: http + httpHeaders: + - name: Host + value: localhost + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + startupProbe: + {{- if .Values.nextcloud.install_ffmpeg }} + exec: + command: + - /bin/sh + - -c + - | + command -v ffmpeg /dev/null 2>&1 || exit 1 + {{- else }} + httpGet: + path: /status.php + port: http + httpHeaders: + - name: Host + value: localhost + {{- end }} + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + volumeMounts: + - name: nextcloud-data + mountPath: /var/www/ + subPath: "root" + - name: nextcloud-data + mountPath: /var/www/html + subPath: "html" + - name: nextcloud-data + mountPath: {{ .Values.nextcloud.datadir }} + subPath: "data" + - name: nextcloud-data + mountPath: /var/www/html/config + subPath: "config" + - name: nextcloud-data + mountPath: /var/www/html/custom_apps + subPath: "custom_apps" + - name: nextcloud-data + mountPath: /var/www/tmp + subPath: "tmp" + - name: nextcloud-data + mountPath: /var/www/html/themes + subPath: "themes" + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + mountPath: {{ $hostPathConfiguration.mountPath }} + {{ end }} + {{- if .Values.nextcloud.install_ffmpeg }} + lifecycle: + postStart: + exec: + command: + - /bin/sh + - -c + - | + echo "Installing ffmpeg..." + apt update && \ + apt install -y --no-install-recommends \ + ffmpeg || echo "Failed to install ffmpeg" + echo "Finished." + {{- end }} +{{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} + volumes: + - name: nginx-configuration + configMap: + defaultMode: 0700 + name: "nginx-configuration" +{{ include "nginx.tlsKeysVolume" . | nindent 8 }} +{{ if .Values.appVolumeMounts }} +{{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} +{{ end }} + {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} + - name: extrappvolume-{{ $index }} + hostPath: + path: {{ $hostPathConfiguration.hostPath }} + {{ end }} + # Will mount configuration files as www-data (id: 33) for nextcloud + securityContext: + fsGroup: 33 diff --git a/charts/nextcloud/1.6.29/templates/nginx-configmap.yaml b/charts/nextcloud/1.6.29/templates/nginx-configmap.yaml new file mode 100644 index 0000000000..a10f4bde6d --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/nginx-configmap.yaml @@ -0,0 +1,67 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: "nginx-configuration" +data: + protocol: {{ include "nginx.scheme" . }} + nginx.conf: |- + events {} + http { + # redirects all http requests to https requests + server { + listen 8000 default_server; + listen [::]:8000 default_server; + return 301 https://$host$request_uri; + } + + server { + server_name localhost; + + listen 443 ssl http2; + listen [::]:433 ssl http2; + + ssl_certificate '/etc/nginx-certs/public.crt'; + ssl_certificate_key '/etc/nginx-certs/private.key'; + + # maximum 3GB Upload File; change to fit your needs + client_max_body_size 3G; + + add_header Strict-Transport-Security "max-age=15552000; includeSubDomains; preload" always; + + location = /robots.txt { + allow all; + log_not_found off; + access_log off; + } + + location = /.well-known/carddav { + return 301 $scheme://$host/remote.php/dav; + } + + location = /.well-known/caldav { + return 301 $scheme://$host/remote.php/dav; + } + + location / { + proxy_pass http://localhost; + proxy_http_version 1.1; + proxy_cache_bypass $http_upgrade; + proxy_request_buffering off; + + # Proxy headers + proxy_set_header Upgrade $http_upgrade; + proxy_set_header Connection "upgrade"; + proxy_set_header Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_set_header X-Forwarded-Proto https; + proxy_set_header X-Forwarded-Host $host; + proxy_set_header X-Forwarded-Port $server_port; + + # Proxy timeouts + proxy_connect_timeout 60s; + proxy_send_timeout 60s; + proxy_read_timeout 60s; + } + } + } diff --git a/charts/nextcloud/1.6.29/templates/nginx-secret.yaml b/charts/nextcloud/1.6.29/templates/nginx-secret.yaml new file mode 100644 index 0000000000..978441509f --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/nginx-secret.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ include "nginx.secretName" . }} +type: Opaque +data: + {{ if eq (include "nginx.certAvailable" .) "true" }} + certPublicKey: {{ (include "nginx.cert.publicKey" .) | toString | b64enc | quote }} + certPrivateKey: {{ (include "nginx.cert.privateKey" .) | toString | b64enc | quote }} + {{ end }} diff --git a/charts/nextcloud/1.6.29/templates/nuke-deployments-hook.yaml b/charts/nextcloud/1.6.29/templates/nuke-deployments-hook.yaml new file mode 100644 index 0000000000..218ea00220 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/nuke-deployments-hook.yaml @@ -0,0 +1,24 @@ +{{- if .Values.ixChartContext.isUpgrade -}} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} +apiVersion: batch/v1 +kind: Job +metadata: + name: "pre-upgrade-hook1" + annotations: + "helm.sh/hook": pre-upgrade + "helm.sh/hook-weight": "-1" + "helm.sh/hook-delete-policy": hook-succeeded + rollme: {{ randAlphaNum 5 | quote }} +spec: + template: + metadata: + name: "pre-upgrade-hook1" + spec: + restartPolicy: Never + serviceAccountName: "{{ template "common.names.serviceAccountName" . }}" + containers: + - name: kubectl + image: "bitnami/kubectl:1.19" + command: ["kubectl", "delete" , "deployment", "{{ template "common.names.fullname" . }}", "{{ template "common.names.fullname" $values }}"] +{{- end -}} diff --git a/charts/nextcloud/1.6.29/templates/postgres-deployment.yaml b/charts/nextcloud/1.6.29/templates/postgres-deployment.yaml new file mode 100644 index 0000000000..b91bb90bd7 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/postgres-deployment.yaml @@ -0,0 +1,50 @@ +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} +{{ include "common.deployment.common_config" $values | nindent 0 }} +spec: {{ include "common.deployment.common_spec" $values | nindent 2 }} + template: {{ include "common.deployment.pod.metadata" $values | nindent 4 }} + spec: + containers: + - name: {{ .Chart.Name }}-postgres + image: {{ template "postgres.imageName" . }} + imagePullPolicy: {{ .Values.image.pullPolicy }} + env: {{ include "postgres.envVariableConfiguration" $values | nindent 10 }} + volumeMounts: {{ include "postgres.volumeMountsConfiguration" $values | nindent 10 }} + ports: + - name: postgres-tcp + containerPort: 5432 + protocol: TCP + readinessProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 2 + livenessProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 10 + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 5 + successThreshold: 1 + startupProbe: + exec: + command: + - sh + - -c + - "until pg_isready -U ${POSTGRES_USER} -h localhost; do sleep 2; done" + initialDelaySeconds: 10 + periodSeconds: 5 + timeoutSeconds: 2 + failureThreshold: 60 + successThreshold: 1 + volumes: {{ include "postgres.volumeConfiguration" $values | nindent 8 }} diff --git a/charts/nextcloud/1.6.29/templates/postgres-secret.yaml b/charts/nextcloud/1.6.29/templates/postgres-secret.yaml new file mode 100644 index 0000000000..2ebc8b9b17 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/postgres-secret.yaml @@ -0,0 +1,22 @@ +{{- $secretName := "db-details" }} +apiVersion: v1 +kind: Secret +metadata: + name: {{ $secretName }} +data: + {{/* + Lookup for the user shouldn't be needed in normal circumstances + But there was a typo before that resulted to a db-user with weird + characters. So to keep that user for existing installations we retrieve + it from the existing secret. + */}} + {{ with (lookup "v1" "Secret" .Release.Namespace $secretName)}} + db-user: {{ index .data "db-user" }} + {{ else }} + db-user: {{ (include "postgres.DatabaseName" .Values ) | b64enc }} + {{ end }} + {{ with (lookup "v1" "Secret" .Release.Namespace $secretName) }} + db-password: {{ index .data "db-password" }} + {{ else }} + db-password: {{ randAlphaNum 15 | b64enc }} + {{ end }} diff --git a/charts/nextcloud/1.6.29/templates/postgres-service.yaml b/charts/nextcloud/1.6.29/templates/postgres-service.yaml new file mode 100644 index 0000000000..c6603fd62b --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/postgres-service.yaml @@ -0,0 +1,6 @@ +{{ $ports := list }} +{{ $ports = mustAppend $ports (dict "name" "postgres-tcp" "port" 5432 "targetPort" 5432) }} +{{ $values := (. | mustDeepCopy) }} +{{ $_ := set $values "common" (dict "nameSuffix" "postgres") }} +{{ $_1 := set $values "commonService" (dict "type" "ClusterIP" "ports" $ports ) }} +{{ include "common.classes.service" $values }} diff --git a/charts/nextcloud/1.6.29/templates/secrets.yaml b/charts/nextcloud/1.6.29/templates/secrets.yaml new file mode 100644 index 0000000000..eb992940b3 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/secrets.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Secret +metadata: + name: {{ template "common.names.fullname" . }} + labels: {{ include "common.labels" . | nindent 4 }} +type: Opaque +data: + nextcloud-username: {{ .Values.nextcloud.username | b64enc | quote }} + {{ if .Values.nextcloud.password }} + nextcloud-password: {{ .Values.nextcloud.password | b64enc | quote }} + {{ else }} + nextcloud-password: {{ randAlphaNum 10 | b64enc | quote }} + {{ end }} diff --git a/charts/nextcloud/1.6.29/templates/service.yaml b/charts/nextcloud/1.6.29/templates/service.yaml new file mode 100644 index 0000000000..14c751eada --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/service.yaml @@ -0,0 +1,10 @@ +{{ $svc := .Values.service }} +{{ $ports := list }} +{{ if eq (include "nginx.certAvailable" .) "true" }} +{{ $ports = mustAppend $ports (dict "name" "nginx-https" "targetPort" 443 "port" 443 "nodePort" $svc.nodePort) }} +{{ else }} +{{ $ports = mustAppend $ports (dict "name" "http" "port" 80 "nodePort" $svc.nodePort) }} +{{ end }} +{{ $params := . }} +{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} +{{ include "common.classes.service" $params }} diff --git a/charts/nextcloud/1.6.29/templates/serviceaccount.yaml b/charts/nextcloud/1.6.29/templates/serviceaccount.yaml new file mode 100644 index 0000000000..48213465b0 --- /dev/null +++ b/charts/nextcloud/1.6.29/templates/serviceaccount.yaml @@ -0,0 +1,35 @@ +{{ include "common.serviceaccount" . | nindent 0 }} + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: RoleBinding +metadata: + name: "{{ .Release.Name }}-service-account-role-binding" +subjects: +- kind: ServiceAccount + name: "{{ template "common.names.serviceAccountName" . }}" + namespace: {{ .Release.Namespace }} +roleRef: + kind: Role + name: "{{ .Release.Name }}-service-account-role" + apiGroup: rbac.authorization.k8s.io + +--- + +apiVersion: rbac.authorization.k8s.io/v1 +kind: Role +metadata: + name: "{{ .Release.Name }}-service-account-role" + namespace: {{ .Release.Namespace }} +rules: + - apiGroups: + - "" + - "apps" + resources: + - pods + - deployments + verbs: + - delete + - get + - list diff --git a/library/ix-dev/charts/nextcloud/to_keep_versions.yaml b/library/ix-dev/charts/nextcloud/to_keep_versions.yaml new file mode 100644 index 0000000000..8a364b8f63 --- /dev/null +++ b/library/ix-dev/charts/nextcloud/to_keep_versions.yaml @@ -0,0 +1 @@ +- 1.6.29