deployment.yaml 3.4 KB

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