diff --git a/test/nextcloud/1.3.6/questions.yaml b/test/nextcloud/1.3.6/questions.yaml index a92be45e6a..b6670f2472 100644 --- a/test/nextcloud/1.3.6/questions.yaml +++ b/test/nextcloud/1.3.6/questions.yaml @@ -17,7 +17,7 @@ groups: portals: web_portal: protocols: - - "http" + - "$kubernetes-resource_configmap_nginx-configuration_protocol" host: - "$variable-nextcloud.host" ports: @@ -52,6 +52,15 @@ questions: type: string required: true + - variable: certificate + description: "Configure Certificate for Nextcloud" + label: "Certificate Configuration" + group: "Nextcloud Configuration" + schema: + type: int + $ref: + - "definitions/certificate" + - variable: nextcloud description: "Nextcloud configuration details" label: "Nextcloud Configuration" diff --git a/test/nextcloud/1.3.6/templates/deployment.yaml b/test/nextcloud/1.3.6/templates/deployment.yaml index 49ad2359be..42004b62c0 100644 --- a/test/nextcloud/1.3.6/templates/deployment.yaml +++ b/test/nextcloud/1.3.6/templates/deployment.yaml @@ -10,6 +10,7 @@ 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: + {{ if eq (include "nginx.certAvailable" .) "true" }} - name: nginx {{ include "common.containers.imageConfig" .Values.nginx.image | nindent 8 }} volumeMounts: @@ -24,6 +25,7 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} - name: nginx-https containerPort: 8443 protocol: TCP + {{ end }} - name: {{ .Chart.Name }} {{ include "common.containers.imageConfig" .Values.image | nindent 8 }} env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }} diff --git a/test/nextcloud/1.3.6/templates/nginx-configmap.yaml b/test/nextcloud/1.3.6/templates/nginx-configmap.yaml index 52be37af7c..adb71910c3 100644 --- a/test/nextcloud/1.3.6/templates/nginx-configmap.yaml +++ b/test/nextcloud/1.3.6/templates/nginx-configmap.yaml @@ -3,6 +3,7 @@ kind: ConfigMap metadata: name: "nginx-configuration" data: + protocol: {{ include "nginx.scheme" . }} config: |- http { # redirects all http requests to https requests diff --git a/test/nextcloud/1.3.6/templates/service.yaml b/test/nextcloud/1.3.6/templates/service.yaml index ead1523381..6b1e42f273 100644 --- a/test/nextcloud/1.3.6/templates/service.yaml +++ b/test/nextcloud/1.3.6/templates/service.yaml @@ -1,6 +1,10 @@ {{ $svc := .Values.service }} {{ $ports := list }} +{{ if eq (include "nginx.certAvailable" .) "true" }} +{{ $ports = mustAppend $ports (dict "name" "nginx-https" "port" 8443 "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 }}