deployment.yaml 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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.resources.limitation" . | nindent 10 }}
  41. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  42. {{ if .Values.extraAppVolumeMounts }}
  43. volumeMounts:
  44. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  45. - name: extrappvolume-{{ $index }}
  46. mountPath: {{ $hostPathConfiguration.mountPath }}
  47. {{ end }}
  48. {{ end }}
  49. ports:
  50. - name: collabora
  51. protocol: TCP
  52. containerPort: 9980
  53. {{ $envList := (default list .Values.environmentVariables) }}
  54. {{ $secretName := (include "secretName" .) }}
  55. {{ $envConfig := .Values.config }}
  56. {{ $envList = mustAppend $envList (dict "name" "timezone" "value" $envConfig.timezone) }}
  57. {{ $envList = mustAppend $envList (dict "name" "domain" "value" $envConfig.domain) }}
  58. {{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
  59. {{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
  60. {{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
  61. {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
  62. {{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
  63. {{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  64. {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
  65. volumes:
  66. - name: configuration
  67. configMap:
  68. defaultMode: 0700
  69. name: "nginx-config"
  70. - name: certs
  71. secret:
  72. secretName: {{ include "secretName" . }}
  73. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  74. - name: extrappvolume-{{ $index }}
  75. hostPath:
  76. path: {{ $hostPathConfiguration.hostPath }}
  77. {{ end }}