Commit bcab69f0 authored by sonicaj's avatar sonicaj

Allow configuring certificate for nextcloud

parent 54972d37
...@@ -17,7 +17,7 @@ groups: ...@@ -17,7 +17,7 @@ groups:
portals: portals:
web_portal: web_portal:
protocols: protocols:
- "http" - "$kubernetes-resource_configmap_nginx-configuration_protocol"
host: host:
- "$variable-nextcloud.host" - "$variable-nextcloud.host"
ports: ports:
...@@ -52,6 +52,15 @@ questions: ...@@ -52,6 +52,15 @@ questions:
type: string type: string
required: true required: true
- variable: certificate
description: "Configure Certificate for Nextcloud"
label: "Certificate Configuration"
group: "Nextcloud Configuration"
schema:
type: int
$ref:
- "definitions/certificate"
- variable: nextcloud - variable: nextcloud
description: "Nextcloud configuration details" description: "Nextcloud configuration details"
label: "Nextcloud Configuration" label: "Nextcloud Configuration"
......
...@@ -10,6 +10,7 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} ...@@ -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"] 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 }} imagePullPolicy: {{ .Values.image.pullPolicy }}
containers: containers:
{{ if eq (include "nginx.certAvailable" .) "true" }}
- name: nginx - name: nginx
{{ include "common.containers.imageConfig" .Values.nginx.image | nindent 8 }} {{ include "common.containers.imageConfig" .Values.nginx.image | nindent 8 }}
volumeMounts: volumeMounts:
...@@ -24,6 +25,7 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }} ...@@ -24,6 +25,7 @@ spec: {{ include "common.deployment.common_spec" . | nindent 2 }}
- name: nginx-https - name: nginx-https
containerPort: 8443 containerPort: 8443
protocol: TCP protocol: TCP
{{ end }}
- name: {{ .Chart.Name }} - name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 8 }} {{ include "common.containers.imageConfig" .Values.image | nindent 8 }}
env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }} env: {{ include "postgres.envVariableConfiguration" $postgres_values | nindent 10 }}
......
...@@ -3,6 +3,7 @@ kind: ConfigMap ...@@ -3,6 +3,7 @@ kind: ConfigMap
metadata: metadata:
name: "nginx-configuration" name: "nginx-configuration"
data: data:
protocol: {{ include "nginx.scheme" . }}
config: |- config: |-
http { http {
# redirects all http requests to https requests # redirects all http requests to https requests
......
{{ $svc := .Values.service }} {{ $svc := .Values.service }}
{{ $ports := list }} {{ $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) }} {{ $ports = mustAppend $ports (dict "name" "http" "port" 80 "nodePort" $svc.nodePort) }}
{{ end }}
{{ $params := . }} {{ $params := . }}
{{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }} {{ $_ := set $params "commonService" (dict "type" "NodePort" "ports" $ports ) }}
{{ include "common.classes.service" $params }} {{ 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