Files
chart/library/ix-dev/charts/collabora/templates/deployment.yaml
Stavros Kois ab6bbb2e99 NAS-124160 / 24.04 / Allow to deploy collabora without certificate (#1549)
* Allow to deploy collabora without certificate

* rename file

* update description
2023-09-19 22:27:17 +03:00

139 lines
5.2 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:
{{ if .Values.certificate }}
- 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
livenessProbe:
httpGet:
scheme: HTTPS
path: /robots.txt
port: 443
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1
readinessProbe:
httpGet:
scheme: HTTPS
path: /robots.txt
port: 443
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 2
startupProbe:
httpGet:
scheme: HTTPS
path: /robots.txt
port: 443
initialDelaySeconds: 10
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 60
successThreshold: 1
{{ end }}
- 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 }}
livenessProbe:
httpGet:
path: /
port: 9980
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1
readinessProbe:
httpGet:
path: /
port: 9980
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1
startupProbe:
httpGet:
path: /
port: 9980
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 5
successThreshold: 1
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" "aliasgroup1" "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:
{{ if .Values.certificate }}
- name: configuration
configMap:
defaultMode: 0700
name: "nginx-config"
- name: certs
secret:
secretName: {{ include "secretName" . }}
{{ end }}
{{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
- name: extrappvolume-{{ $index }}
hostPath:
path: {{ $hostPathConfiguration.hostPath }}
{{ end }}