From 54972d376f8e962e1fa4c511fcf300af28e7c5ce Mon Sep 17 00:00:00 2001 From: sonicaj Date: Mon, 11 Oct 2021 19:02:36 +0500 Subject: [PATCH] Add nginx as a sidecar to nextcloud deployment --- .../nextcloud/1.3.6/templates/deployment.yaml | 23 ++++++++++++++++++- .../1.3.6/templates/nginx-secret.yaml | 10 ++++++++ 2 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 test/nextcloud/1.3.6/templates/nginx-secret.yaml diff --git a/test/nextcloud/1.3.6/templates/deployment.yaml b/test/nextcloud/1.3.6/templates/deployment.yaml index 49b4f1683b..49ad2359be 100644 --- a/test/nextcloud/1.3.6/templates/deployment.yaml +++ b/test/nextcloud/1.3.6/templates/deployment.yaml @@ -10,6 +10,20 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} command: ['sh', '-c', "until pg_isready -h {{ template "common.names.fullname" $postgres_values }}; do echo waiting for postgres; sleep 2; done"] imagePullPolicy: {{ .Values.image.pullPolicy }} containers: + - name: nginx + {{ include "common.containers.imageConfig" .Values.nginx.image | nindent 8 }} + volumeMounts: + - name: nginx-configuration + mountPath: /etc/nginx/nginx.conf + subPath: config + {{ include "nginx.tlsKeysVolumeMount" . | nindent 10 }} + ports: + - name: nginx-http + containerPort: 8000 + protocol: TCP + - name: nginx-https + containerPort: 8443 + protocol: TCP - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 8 }} env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }} @@ -53,7 +67,14 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} mountPath: {{ $hostPathConfiguration.mountPath }} {{ end }} {{ include "common.networking.dnsConfiguration" .Values | nindent 6 }} -{{ include "common.storage.allAppVolumes" .Values | nindent 6 }} + volumes: + - name: nginx-configuration + configMap: + defaultMode: 0700 + name: "nginx-configuration" +{{ if .Values.appVolumeMounts }} +{{ include "common.storage.configureAppVolumes" .Values | nindent 8 }} +{{ end }} {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }} - name: extrappvolume-{{ $index }} hostPath: diff --git a/test/nextcloud/1.3.6/templates/nginx-secret.yaml b/test/nextcloud/1.3.6/templates/nginx-secret.yaml new file mode 100644 index 0000000000..978441509f --- /dev/null +++ b/test/nextcloud/1.3.6/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 }}