Files
charts/test/collabora/1.2.6/templates/deployment.yaml
T

78 lines
3.5 KiB
YAML

{{ include "common.storage.hostPathValidate" .Values }}
apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
kind: Deployment
metadata:
name: {{ template "common.names.fullname" . }}
labels: {{ include "common.labels" . | nindent 4 }}
spec:
strategy:
type: {{ .Values.updateStrategy }}
selector:
matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
template:
metadata:
name: {{ template "common.names.fullname" . }}
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.resources.limitation" . | nindent 10 }}
{{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
{{ if .Values.extraAppVolumeMounts }}
volumeMounts:
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
mountPath: {{ $hostPathConfiguration.mountPath }}
{{ end }}
{{ end }}
ports:
- name: collabora
protocol: TCP
containerPort: 9980
{{ $envList := (default list .Values.environmentVariables) }}
{{ $secretName := (include "secretName" .) }}
{{ $envConfig := .Values.config }}
{{ $envList = mustAppend $envList (dict "name" "timezone" "value" $envConfig.timezone) }}
{{ $envList = mustAppend $envList (dict "name" "domain" "value" $envConfig.domain) }}
{{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
{{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
{{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
{{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
{{ $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 }}
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 }}