Commit bcab69f0 authored by sonicaj's avatar sonicaj

Allow configuring certificate for nextcloud

parent 54972d37
......@@ -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"
......
......@@ -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 }}
......
......@@ -3,6 +3,7 @@ kind: ConfigMap
metadata:
name: "nginx-configuration"
data:
protocol: {{ include "nginx.scheme" . }}
config: |-
http {
# redirects all http requests to https requests
......
{{ $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 }}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment