deployment.yaml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  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. livenessProbe:
  40. httpGet:
  41. scheme: HTTPS
  42. path: /robots.txt
  43. port: 443
  44. initialDelaySeconds: 10
  45. periodSeconds: 10
  46. timeoutSeconds: 5
  47. failureThreshold: 5
  48. successThreshold: 1
  49. readinessProbe:
  50. httpGet:
  51. scheme: HTTPS
  52. path: /robots.txt
  53. port: 443
  54. initialDelaySeconds: 10
  55. periodSeconds: 10
  56. timeoutSeconds: 5
  57. failureThreshold: 5
  58. successThreshold: 2
  59. startupProbe:
  60. httpGet:
  61. scheme: HTTPS
  62. path: /robots.txt
  63. port: 443
  64. initialDelaySeconds: 10
  65. periodSeconds: 5
  66. timeoutSeconds: 2
  67. failureThreshold: 60
  68. successThreshold: 1
  69. - name: {{ .Chart.Name }}
  70. {{ include "common.resources.limitation" . | nindent 10 }}
  71. {{ include "common.containers.imageConfig" .Values.image | nindent 10 }}
  72. {{ if .Values.extraAppVolumeMounts }}
  73. volumeMounts:
  74. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  75. - name: extrappvolume-{{ $index }}
  76. mountPath: {{ $hostPathConfiguration.mountPath }}
  77. {{ end }}
  78. {{ end }}
  79. livenessProbe:
  80. httpGet:
  81. path: /
  82. port: 9980
  83. initialDelaySeconds: 10
  84. periodSeconds: 10
  85. timeoutSeconds: 5
  86. failureThreshold: 5
  87. successThreshold: 1
  88. readinessProbe:
  89. httpGet:
  90. path: /
  91. port: 9980
  92. initialDelaySeconds: 10
  93. periodSeconds: 10
  94. timeoutSeconds: 5
  95. failureThreshold: 5
  96. successThreshold: 1
  97. startupProbe:
  98. httpGet:
  99. path: /
  100. port: 9980
  101. initialDelaySeconds: 10
  102. periodSeconds: 10
  103. timeoutSeconds: 5
  104. failureThreshold: 5
  105. successThreshold: 1
  106. ports:
  107. - name: collabora
  108. protocol: TCP
  109. containerPort: 9980
  110. {{ $envList := (default list .Values.environmentVariables) }}
  111. {{ $secretName := (include "secretName" .) }}
  112. {{ $envConfig := .Values.config }}
  113. {{ $envList = mustAppend $envList (dict "name" "timezone" "value" $envConfig.timezone) }}
  114. {{ $envList = mustAppend $envList (dict "name" "aliasgroup1" "value" $envConfig.domain) }}
  115. {{ $envList = mustAppend $envList (dict "name" "dictionaries" "value" $envConfig.dictionaries) }}
  116. {{ $envList = mustAppend $envList (dict "name" "extra_params" "value" $envConfig.extra_params) }}
  117. {{ $envList = mustAppend $envList (dict "name" "DONT_GEN_SSL_CERT" "value" "true") }}
  118. {{ $envList = mustAppend $envList (dict "name" "server_name" "value" (printf "%v:%v" $envConfig.server_name .Values.nodePort)) }}
  119. {{ $envList = mustAppend $envList (dict "name" "username" "valueFromSecret" true "secretName" $secretName "secretKey" "username") }}
  120. {{ $envList = mustAppend $envList (dict "name" "password" "valueFromSecret" true "secretName" $secretName "secretKey" "password") }}
  121. {{ include "common.containers.allEnvironmentVariables" (dict "environmentVariables" $envList) | nindent 10 }}
  122. volumes:
  123. - name: configuration
  124. configMap:
  125. defaultMode: 0700
  126. name: "nginx-config"
  127. - name: certs
  128. secret:
  129. secretName: {{ include "secretName" . }}
  130. {{ range $index, $hostPathConfiguration := .Values.extraAppVolumeMounts }}
  131. - name: extrappvolume-{{ $index }}
  132. hostPath:
  133. path: {{ $hostPathConfiguration.hostPath }}
  134. {{ end }}