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.

118 lines
4.9 KiB

  1. {{- if and .Values.dynamicConfig.enabled .Values.dynamicConfig.upload.enabled -}}
  2. apiVersion: apps/v1
  3. kind: StatefulSet
  4. metadata:
  5. name: {{ include "collabora-online.fullname" . }}-dynconfig
  6. labels:
  7. {{- include "collabora-online.labels" . | nindent 4 }}
  8. spec:
  9. serviceName: {{ include "collabora-online.fullname" . }}-dynconfig
  10. replicas: 1
  11. selector:
  12. matchLabels:
  13. {{- include "collabora-online.selectorLabels" . | nindent 6 }}
  14. type: dynconfig
  15. template:
  16. metadata:
  17. {{- with .Values.dynamicConfig.podAnnotations }}
  18. annotations:
  19. {{- toYaml . | nindent 8 }}
  20. {{- end }}
  21. labels:
  22. {{- include "collabora-online.selectorLabels" . | nindent 8 }}
  23. type: dynconfig
  24. # confighash: config-{{ .Values | toYaml | sha256sum | trunc 32 }}
  25. spec:
  26. {{- with .Values.imagePullSecrets }}
  27. imagePullSecrets:
  28. {{- toYaml . | nindent 8 }}
  29. {{- end }}
  30. serviceAccountName: {{ include "collabora-online.serviceAccountName" . }}
  31. securityContext:
  32. {{- toYaml .Values.dynamicConfig.podSecurityContext | nindent 8 }}
  33. containers:
  34. - name: {{ .Chart.Name }}-dynconfig
  35. securityContext:
  36. {{- toYaml .Values.dynamicConfig.securityContext | nindent 12 }}
  37. image: "{{ .Values.dynamicConfig.image.repository }}:{{ .Values.dynamicConfig.image.tag }}"
  38. imagePullPolicy: {{ .Values.dynamicConfig.image.pullPolicy }}
  39. ports:
  40. - name: http
  41. containerPort: {{ .Values.dynamicConfig.containerPort }}
  42. protocol: TCP
  43. {{- if .Values.probes.startup.enabled }}
  44. startupProbe:
  45. httpGet:
  46. path: /
  47. port: {{ .Values.dynamicConfig.containerPort }}
  48. scheme: HTTP
  49. failureThreshold: {{ .Values.dynamicConfig.probes.startup.failureThreshold }}
  50. periodSeconds: {{ .Values.dynamicConfig.probes.startup.periodSeconds }}
  51. {{- end }}
  52. {{- if .Values.dynamicConfig.probes.liveness.enabled }}
  53. livenessProbe:
  54. httpGet:
  55. path: /
  56. port: {{ .Values.dynamicConfig.containerPort }}
  57. scheme: HTTP
  58. initialDelaySeconds: {{ .Values.dynamicConfig.probes.liveness.initialDelaySeconds }}
  59. periodSeconds: {{ .Values.dynamicConfig.probes.liveness.periodSeconds }}
  60. timeoutSeconds: {{ .Values.dynamicConfig.probes.liveness.timeoutSeconds }}
  61. successThreshold: {{ .Values.dynamicConfig.probes.liveness.successThreshold }}
  62. failureThreshold: {{ .Values.dynamicConfig.probes.liveness.failureThreshold }}
  63. {{- end }}
  64. {{- if .Values.dynamicConfig.probes.readiness.enabled }}
  65. readinessProbe:
  66. httpGet:
  67. path: /
  68. port: {{ .Values.dynamicConfig.containerPort }}
  69. scheme: HTTP
  70. initialDelaySeconds: {{ .Values.dynamicConfig.probes.readiness.initialDelaySeconds }}
  71. periodSeconds: {{ .Values.dynamicConfig.probes.readiness.periodSeconds }}
  72. timeoutSeconds: {{ .Values.dynamicConfig.probes.readiness.timeoutSeconds }}
  73. successThreshold: {{ .Values.dynamicConfig.probes.readiness.successThreshold }}
  74. failureThreshold: {{ .Values.dynamicConfig.probes.readiness.failureThreshold }}
  75. {{- end }}
  76. {{- with .Values.dynamicConfig.env }}
  77. {{ toYaml . | nindent 12 }}
  78. {{- end }}
  79. resources:
  80. {{- toYaml .Values.dynamicConfig.resources | nindent 12 }}
  81. volumeMounts:
  82. - name: config
  83. mountPath: /usr/share/nginx/html/config
  84. - name: {{ .Chart.Name }}-dynconfig-upload
  85. image: {{ .Values.dynamicConfig.upload.image.repository }}@sha256:{{ .Values.dynamicConfig.upload.image.digest }}
  86. envFrom:
  87. - secretRef:
  88. name: {{ include "collabora-online.fullname" . }}-upload-env
  89. ports:
  90. - name: "upload-http"
  91. containerPort: 3000
  92. volumeMounts:
  93. - name: "config"
  94. mountPath: "/config"
  95. {{- with .Values.dynamicConfig.nodeSelector }}
  96. nodeSelector:
  97. {{- toYaml . | nindent 8 }}
  98. {{- end }}
  99. {{- with .Values.dynamicConfig.affinity }}
  100. affinity:
  101. {{- toYaml . | nindent 8 }}
  102. {{- end }}
  103. {{- with .Values.dynamicConfig.tolerations }}
  104. tolerations:
  105. {{- toYaml . | nindent 8 }}
  106. {{- end }}
  107. volumeClaimTemplates:
  108. - metadata:
  109. name: config
  110. spec:
  111. accessModes: [ "{{ .Values.dynamicConfig.upload.pvc.accessMode }}" ]
  112. resources:
  113. requests:
  114. storage: {{ .Values.dynamicConfig.upload.pvc.size }}
  115. {{- if .Values.dynamicConfig.upload.pvc.storageClassName }}
  116. storageClassName: {{ .Values.dynamicConfig.upload.pvc.storageClassName }}
  117. {{- end }}
  118. {{- end }}