Commit fbb2fe07 authored by sonicaj's avatar sonicaj

Have nginx as a sidecar instead of a separate deployment

parent a6a0ad54
......@@ -14,6 +14,27 @@ spec:
labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
spec:
containers:
- name: {{ .Chart.Name }}-nginx
image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
volumeMounts:
- name: configuration
mountPath: /etc/nginx/nginx.conf
readOnly: true
subPath: config
- name: certs
mountPath: /etc/nginx/server.crt
subPath: certPublicKey
- name: certs
mountPath: /etc/nginx/server.key
subPath: certPrivateKey
ports:
- name: http
containerPort: 80
protocol: TCP
- name: https
containerPort: 443
protocol: TCP
- name: {{ .Chart.Name }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ if .Values.extraAppVolumeMounts }}
......@@ -40,11 +61,16 @@ spec:
{{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
{{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
{{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
{{ if .Values.extraAppVolumeMounts }}
volumes:
- name: configuration
configMap:
defaultMode: 0700
name: "nginx-config"
- name: certs
secret:
secretName: {{ include "secretName" . }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}
{{ end }}
{{- $serviceName := include "common.names.fullname" . -}}
{{- if hasKey .Values "nameSuffix" -}}
{{- $serviceName = (printf "%v-%v" $serviceName .Values.nameSuffix) -}}
{{- end -}}
{{- $serviceName := "localhost" -}}
apiVersion: v1
kind: ConfigMap
metadata:
......
{{ $values := (. | mustDeepCopy) }}
{{ $_ := set $values "common" (dict "nameSuffix" "nginx") }}
{{ 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 }}-nginx
image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
volumeMounts:
- name: configuration
mountPath: /etc/nginx/nginx.conf
readOnly: true
subPath: config
- name: certs
mountPath: /etc/nginx/server.crt
subPath: certPublicKey
- name: certs
mountPath: /etc/nginx/server.key
subPath: certPrivateKey
ports:
- name: http
containerPort: 80
protocol: TCP
- name: https
containerPort: 443
protocol: TCP
volumes:
- name: configuration
configMap:
defaultMode: 0700
name: "nginx-config"
- name: certs
secret:
secretName: {{ include "secretName" . }}
{{ $port := .Values.nodePort }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "https" "port" $port "nodePort" $port "targetPort" "https") }}
{{ $ports = mustAppend $ports (dict "name" "https" "nodePort" $port "targetPort" 443 "port" 443) }}
{{ $params := (. | mustDeepCopy) }}
{{ $_ := set $params "common" (dict "nameSuffix" "nginx") }}
{{ $_2 := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }}
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "NodePort" ) }}
{{ include "common.classes.service" $params }}
{{ $port := .Values.nodePort }}
{{ $ports := list }}
{{ $ports = mustAppend $ports (dict "name" "collabora" "port" 9980 "targetPort" "collabora") }}
{{ $params := . }}
{{ $_ := set $params "commonService" (dict "ports" $ports "type" "ClusterIP" ) }}
{{ 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