deployment.yaml 3.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {{ include "common.storage.hostPathValidate" .Values }}
  2. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "common.names.fullname" . }}
  6. labels: {{ include "common.labels" . | nindent 4 }}
  7. spec:
  8. strategy:
  9. type: {{ .Values.updateStrategy }}
  10. selector:
  11. matchLabels: {{ include "common.labels.selectorLabels" . | nindent 6 }}
  12. template:
  13. metadata:
  14. name: {{ template "common.names.fullname" . }}
  15. labels: {{ include "common.labels.selectorLabels" . | nindent 8 }}
  16. spec:
  17. containers:
  18. - name: {{ .Chart.Name }}-nginx
  19. image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
  20. imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
  21. volumeMounts:
  22. - name: configuration
  23. mountPath: /etc/nginx/nginx.conf
  24. readOnly: true
  25. subPath: config
  26. - name: certs
  27. mountPath: /etc/nginx/server.crt
  28. subPath: certPublicKey
  29. - name: certs
  30. mountPath: /etc/nginx/server.key
  31. subPath: certPrivateKey
  32. ports:
  33. - name: http
  34. containerPort: 80
  35. protocol: TCP
  36. - name: https
  37. containerPort: 443
  38. protocol: TCP
  39. - name: {{ .Chart.Name }}
  40. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  41. {{ if .Values.extraAppVolumeMounts }}
  42. volumeMounts:
  43. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  44. - name: extrappvolume-{{ $index }}
  45. mountPath: {{ $hostPathConfiguration.mountPath }}
  46. {{ end }}
  47. {{ end }}
  48. ports:
  49. - name: collabora
  50. protocol: TCP
  51. containerPort: 9980
  52. {{ $envList := (default list .Values.environmentVariables) }}
  53. {{ $secretName := (include "secretName" .) }}
  54. {{ $envConfig := .Values.config }}
  55. {{ $envList = mustAppend $envList (dict "name" "timezone" "value" $envConfig.timezone) }}
  56. {{ $envList = mustAppend $envList (dict "name" "domain" "value" $envConfig.domain) }}
  57. {{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
  58. {{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
  59. {{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
  60. {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
  61. {{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
  62. {{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  63. {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
  64. volumes:
  65. - name: configuration
  66. configMap:
  67. defaultMode: 0700
  68. name: "nginx-config"
  69. - name: certs
  70. secret:
  71. secretName: {{ include "secretName" . }}
  72. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  73. - name: extrappvolume-{{ $index }}
  74. hostPath:
  75. path: {{ $hostPathConfiguration.hostPath }}
  76. {{ end }}