helm collabora kubernetes
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

140 lines
5.3 KiB

  1. {{- if eq .Values.deployment.kind "Deployment" -}}
  2. ---
  3. apiVersion: apps/v1
  4. kind: Deployment
  5. metadata:
  6. name: {{ include "collabora-online.fullname" . }}
  7. labels:
  8. {{- include "collabora-online.labels" . | nindent 4 }}
  9. spec:
  10. minReadySeconds: {{ .Values.deployment.minReadySeconds }}
  11. {{- if not .Values.autoscaling.enabled }}
  12. replicas: {{ .Values.replicaCount }}
  13. {{- end }}
  14. strategy:
  15. type: {{ .Values.deployment.type }}
  16. {{- if eq .Values.deployment.type "RollingUpdate"}}
  17. rollingUpdate:
  18. maxSurge: {{ .Values.deployment.maxSurge }}
  19. maxUnavailable: {{ .Values.deployment.maxUnavailable }}
  20. {{- end}}
  21. selector:
  22. matchLabels:
  23. {{- include "collabora-online.selectorLabels" . | nindent 6 }}
  24. type: main
  25. template:
  26. metadata:
  27. annotations:
  28. {{- with .Values.podAnnotations }}
  29. {{- toYaml . | nindent 8 }}
  30. {{- end }}
  31. confighash: config-{{ .Values.collabora | toYaml | sha256sum | trunc 32 }}
  32. cluster-autoscaler.kubernetes.io/safe-to-evict: "true"
  33. labels:
  34. {{- include "collabora-online.selectorLabels" . | nindent 8 }}
  35. type: main
  36. spec:
  37. {{- with .Values.deployment.hostAliases }}
  38. hostAliases:
  39. {{- toYaml . | nindent 8 }}
  40. {{- end }}
  41. terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
  42. {{- with .Values.imagePullSecrets }}
  43. imagePullSecrets:
  44. {{- toYaml . | nindent 8 }}
  45. {{- end }}
  46. serviceAccountName: {{ include "collabora-online.serviceAccountName" . }}
  47. securityContext:
  48. {{- toYaml .Values.podSecurityContext | nindent 8 }}
  49. containers:
  50. - name: {{ .Chart.Name }}
  51. securityContext:
  52. {{- toYaml .Values.securityContext | nindent 12 }}
  53. image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
  54. imagePullPolicy: {{ .Values.image.pullPolicy }}
  55. ports:
  56. - name: http
  57. containerPort: {{ .Values.deployment.containerPort }}
  58. protocol: TCP
  59. {{- if .Values.probes.startup.enabled }}
  60. startupProbe:
  61. httpGet:
  62. path: /
  63. port: {{ .Values.deployment.containerPort }}
  64. scheme: HTTP
  65. failureThreshold: {{ .Values.probes.startup.failureThreshold }}
  66. periodSeconds: {{ .Values.probes.startup.periodSeconds }}
  67. {{- end }}
  68. {{- if .Values.probes.liveness.enabled }}
  69. livenessProbe:
  70. httpGet:
  71. path: /
  72. port: {{ .Values.deployment.containerPort }}
  73. scheme: HTTP
  74. initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
  75. periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
  76. timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
  77. successThreshold: {{ .Values.probes.liveness.successThreshold }}
  78. failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
  79. {{- end }}
  80. {{- if .Values.probes.readiness.enabled }}
  81. readinessProbe:
  82. httpGet:
  83. path: /
  84. port: {{ .Values.deployment.containerPort }}
  85. scheme: HTTP
  86. initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
  87. periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
  88. timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
  89. successThreshold: {{ .Values.probes.readiness.successThreshold }}
  90. failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
  91. {{- end }}
  92. envFrom:
  93. - configMapRef:
  94. name: {{ include "collabora-online.fullname" . }}
  95. env:
  96. - name: username
  97. valueFrom:
  98. secretKeyRef:
  99. {{- if (.Values.collabora.existingSecret).enabled }}
  100. name: {{ .Values.collabora.existingSecret.secretName | quote }}
  101. key: {{ .Values.collabora.existingSecret.usernameKey | quote }}
  102. {{- else }}
  103. name: {{ include "collabora-online.fullname" . }}
  104. key: username
  105. {{- end }}
  106. - name: password
  107. valueFrom:
  108. secretKeyRef:
  109. {{- if (.Values.collabora.existingSecret).enabled }}
  110. name: {{ .Values.collabora.existingSecret.secretName | quote }}
  111. key: {{ .Values.collabora.existingSecret.passwordKey | quote }}
  112. {{- else }}
  113. name: {{ include "collabora-online.fullname" . }}
  114. key: password
  115. {{- end }}
  116. {{- with .Values.collabora.env }}
  117. {{ toYaml . | nindent 12 }}
  118. {{- end }}
  119. resources:
  120. {{- toYaml .Values.resources | nindent 12 }}
  121. volumeMounts:
  122. - name: tmp
  123. mountPath: /tmp
  124. {{- with .Values.nodeSelector }}
  125. nodeSelector:
  126. {{- toYaml . | nindent 8 }}
  127. {{- end }}
  128. {{- with .Values.affinity }}
  129. affinity:
  130. {{- toYaml . | nindent 8 }}
  131. {{- end }}
  132. {{- with .Values.tolerations }}
  133. tolerations:
  134. {{- toYaml . | nindent 8 }}
  135. {{- end }}
  136. volumes:
  137. - name: tmp
  138. emptyDir: {}
  139. {{- end }}