deployment.yaml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. {{ include "common.storage.hostPathValidate" .Values }}
  2. apiVersion: {{ template "common.capabilities.deployment.apiVersion" . }}
  3. kind: Deployment
  4. metadata:
  5. name: {{ template "common.names.fullname" . }}-collabora
  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. {{ if .Values.certificate }}
  19. - name: {{ .Chart.Name }}-nginx
  20. image: {{ printf "%s:%s" .Values.nginx.image.repository .Values.nginx.image.tag }}
  21. imagePullPolicy: {{ .Values.nginx.image.pullPolicy }}
  22. volumeMounts:
  23. - name: configuration
  24. mountPath: /etc/nginx/nginx.conf
  25. readOnly: true
  26. subPath: config
  27. - name: certs
  28. mountPath: /etc/nginx/server.crt
  29. subPath: certPublicKey
  30. - name: certs
  31. mountPath: /etc/nginx/server.key
  32. subPath: certPrivateKey
  33. ports:
  34. - name: http
  35. containerPort: 80
  36. protocol: TCP
  37. - name: https
  38. containerPort: 443
  39. protocol: TCP
  40. livenessProbe:
  41. httpGet:
  42. scheme: HTTPS
  43. path: /robots.txt
  44. port: 443
  45. initialDelaySeconds: 10
  46. periodSeconds: 10
  47. timeoutSeconds: 5
  48. failureThreshold: 5
  49. successThreshold: 1
  50. readinessProbe:
  51. httpGet:
  52. scheme: HTTPS
  53. path: /robots.txt
  54. port: 443
  55. initialDelaySeconds: 10
  56. periodSeconds: 10
  57. timeoutSeconds: 5
  58. failureThreshold: 5
  59. successThreshold: 2
  60. startupProbe:
  61. httpGet:
  62. scheme: HTTPS
  63. path: /robots.txt
  64. port: 443
  65. initialDelaySeconds: 10
  66. periodSeconds: 5
  67. timeoutSeconds: 2
  68. failureThreshold: 60
  69. successThreshold: 1
  70. {{ end }}
  71. - name: {{ .Chart.Name }}
  72. {{ include "common.resources.limitation" . | nindent 10 }}
  73. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  74. {{ if .Values.extraAppVolumeMounts }}
  75. volumeMounts:
  76. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  77. - name: extrappvolume-{{ $index }}
  78. mountPath: {{ $hostPathConfiguration.mountPath }}
  79. {{ end }}
  80. {{ end }}
  81. livenessProbe:
  82. httpGet:
  83. path: /
  84. port: 9980
  85. initialDelaySeconds: 10
  86. periodSeconds: 10
  87. timeoutSeconds: 5
  88. failureThreshold: 5
  89. successThreshold: 1
  90. readinessProbe:
  91. httpGet:
  92. path: /
  93. port: 9980
  94. initialDelaySeconds: 10
  95. periodSeconds: 10
  96. timeoutSeconds: 5
  97. failureThreshold: 5
  98. successThreshold: 1
  99. startupProbe:
  100. httpGet:
  101. path: /
  102. port: 9980
  103. initialDelaySeconds: 10
  104. periodSeconds: 10
  105. timeoutSeconds: 5
  106. failureThreshold: 5
  107. successThreshold: 1
  108. ports:
  109. - name: collabora
  110. protocol: TCP
  111. containerPort: 9980
  112. {{ $envList := (default list .Values.environmentVariables) }}
  113. {{ $secretName := (include "secretName" .) }}
  114. {{ $envConfig := .Values.config }}
  115. {{ $envList = mustAppend $envList (dict "name" "timezone" "value" $envConfig.timezone) }}
  116. {{ $envList = mustAppend $envList (dict "name" "aliasgroup1" "value" (join "," $envConfig.aliasgroup1)) }}
  117. {{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
  118. {{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
  119. {{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
  120. {{ if not (contains ":" $envConfig.server_name) }}
  121. {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
  122. {{ else }}
  123. {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v" $envConfig.server_name)) }}
  124. {{ end }}
  125. {{ if $envConfig.enableWebUI }}
  126. {{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
  127. {{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  128. {{ end }}
  129. {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
  130. volumes:
  131. {{ if .Values.certificate }}
  132. - name: configuration
  133. configMap:
  134. defaultMode: 0700
  135. name: "nginx-config"
  136. - name: certs
  137. secret:
  138. secretName: {{ include "secretName" . }}
  139. {{ end }}
  140. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  141. - name: extrappvolume-{{ $index }}
  142. hostPath:
  143. path: {{ $hostPathConfiguration.hostPath }}
  144. {{ end }}