deployment.yaml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. # Copyright Materialize, Inc. and contributors. All rights reserved.
  2. #
  3. # Use of this software is governed by the Business Source License
  4. # included in the LICENSE file at the root of this repository.
  5. #
  6. # As of the Change Date specified in that file, in accordance with
  7. # the Business Source License, use of this software will be governed
  8. # by the Apache License, Version 2.0.
  9. ---
  10. apiVersion: apps/v1
  11. kind: Deployment
  12. metadata:
  13. name: {{ include "materialize-operator.fullname" . }}
  14. namespace: {{ .Release.Namespace }}
  15. labels:
  16. {{- include "materialize-operator.labels" . | nindent 4 }}
  17. spec:
  18. replicas: 1
  19. selector:
  20. matchLabels:
  21. {{- include "materialize-operator.selectorLabels" . | nindent 6 }}
  22. template:
  23. metadata:
  24. labels:
  25. {{- include "materialize-operator.selectorLabels" . | nindent 8 }}
  26. spec:
  27. serviceAccountName: {{ include "materialize-operator.serviceAccountName" . }}
  28. {{- if .Values.operator.nodeSelector }}
  29. nodeSelector:
  30. {{- toYaml .Values.operator.nodeSelector | nindent 8 }}
  31. {{- end }}
  32. {{- if .Values.operator.affinity }}
  33. affinity:
  34. {{- toYaml .Values.operator.affinity | nindent 8 }}
  35. {{- end }}
  36. {{- if .Values.operator.tolerations }}
  37. tolerations:
  38. {{- toYaml .Values.operator.tolerations | nindent 8 }}
  39. {{- end }}
  40. containers:
  41. - name: {{ .Chart.Name }}
  42. image: "{{ .Values.operator.image.repository }}:{{ .Values.operator.image.tag }}"
  43. imagePullPolicy: {{ .Values.operator.image.pullPolicy }}
  44. args:
  45. - "--helm-chart-version={{ .Chart.Version }}"
  46. - "--startup-log-filter={{ .Values.operator.args.startupLogFilter }}"
  47. - "--cloud-provider={{ .Values.operator.cloudProvider.type }}"
  48. - "--region={{ .Values.operator.cloudProvider.region }}"
  49. - "--secrets-controller={{ .Values.operator.secretsController }}"
  50. # (SangJunBak) For self-managed, we disable statement logging due to performance issues
  51. # https://github.com/MaterializeInc/cloud/issues/10755
  52. - "--disable-statement-logging"
  53. {{- range $key, $value := include "materialize-operator.selectorLabels" . | fromYaml }}
  54. - "--orchestratord-pod-selector-labels={{ $key }}={{ $value }}"
  55. {{- end }}
  56. {{- if .Values.operator.args.enableInternalStatementLogging }}
  57. - "--enable-internal-statement-logging"
  58. {{- end }}
  59. - "--disable-license-key-checks"
  60. {{/* AWS Configuration */}}
  61. {{- if eq .Values.operator.cloudProvider.type "aws" }}
  62. {{- with .Values.operator.cloudProvider.providers.aws }}
  63. {{- if .accountID }}
  64. - "--aws-account-id={{ .accountID }}"
  65. {{- end }}
  66. {{- if .iam.roles.environment }}
  67. - "--environmentd-iam-role-arn={{ .iam.roles.environment }}"
  68. {{- end }}
  69. {{- if .iam.roles.connection }}
  70. - "--environmentd-connection-role-arn={{ .iam.roles.connection }}"
  71. {{- end }}
  72. {{- end }}
  73. {{- end }}
  74. {{/* Feature Flags */}}
  75. {{- if .Values.balancerd.enabled }}
  76. - "--create-balancers"
  77. {{- end }}
  78. {{- if .Values.console.enabled }}
  79. - "--create-console"
  80. {{- end }}
  81. - "--console-image-tag-default=25.2.3"
  82. {{- range $key, $value := .Values.console.imageTagMapOverride }}
  83. - "--console-image-tag-map={{ $key }}={{ $value }}"
  84. {{- end }}
  85. {{/* Cluster Configuration */}}
  86. {{- if .Values.operator.clusters }}
  87. {{- if .Values.operator.clusters.sizes }}
  88. - '--environmentd-cluster-replica-sizes={{ include "materialize.processClusterSizes" . | fromYaml | toJson }}'
  89. {{- end }}
  90. {{ if .Values.operator.clusters.defaultSizes.default }}
  91. - "--bootstrap-default-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.default }}"
  92. {{- end }}
  93. {{ if .Values.operator.clusters.defaultSizes.system }}
  94. - "--bootstrap-builtin-system-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.system }}"
  95. {{- end }}
  96. {{ if .Values.operator.clusters.defaultSizes.probe }}
  97. - "--bootstrap-builtin-probe-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.probe }}"
  98. {{- end }}
  99. {{ if .Values.operator.clusters.defaultSizes.support }}
  100. - "--bootstrap-builtin-support-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.support }}"
  101. {{- end }}
  102. {{ if .Values.operator.clusters.defaultSizes.catalogServer }}
  103. - "--bootstrap-builtin-catalog-server-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.catalogServer }}"
  104. {{- end }}
  105. {{ if .Values.operator.clusters.defaultSizes.analytics }}
  106. - "--bootstrap-builtin-analytics-cluster-replica-size={{ .Values.operator.clusters.defaultSizes.analytics }}"
  107. {{- end }}
  108. {{ if ne .Values.operator.clusters.defaultReplicationFactor.system nil }}
  109. - "--bootstrap-builtin-system-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.system }}"
  110. {{- end }}
  111. {{ if ne .Values.operator.clusters.defaultReplicationFactor.probe nil }}
  112. - "--bootstrap-builtin-probe-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.probe }}"
  113. {{- end }}
  114. {{ if ne .Values.operator.clusters.defaultReplicationFactor.support nil }}
  115. - "--bootstrap-builtin-support-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.support }}"
  116. {{- end }}
  117. {{ if ne .Values.operator.clusters.defaultReplicationFactor.analytics nil }}
  118. - "--bootstrap-builtin-analytics-cluster-replication-factor={{ .Values.operator.clusters.defaultReplicationFactor.analytics }}"
  119. {{- end }}
  120. {{- end }}
  121. - "--image-pull-policy={{ kebabcase .Values.operator.image.pullPolicy }}"
  122. {{- if .Values.environmentd.nodeSelector }}
  123. {{- range $key, $value := .Values.environmentd.nodeSelector }}
  124. - "--environmentd-node-selector={{ $key }}={{ $value }}"
  125. {{- end }}
  126. {{- end }}
  127. {{- if .Values.environmentd.affinity }}
  128. - '--environmentd-affinity={{ toJson .Values.environmentd.affinity }}'
  129. {{- end }}
  130. {{- if .Values.environmentd.tolerations }}
  131. {{- range $toleration := .Values.environmentd.tolerations }}
  132. - '--environmentd-toleration={{ toJson $toleration }}'
  133. {{- end }}
  134. {{- end }}
  135. {{- if .Values.clusterd.nodeSelector }}
  136. {{- range $key, $value := .Values.clusterd.nodeSelector }}
  137. - "--clusterd-node-selector={{ $key }}={{ $value }}"
  138. {{- end }}
  139. {{- end }}
  140. {{- if .Values.clusterd.affinity }}
  141. - '--clusterd-affinity={{ toJson .Values.clusterd.affinity }}'
  142. {{- end }}
  143. {{- if .Values.clusterd.tolerations }}
  144. {{- range $toleration := .Values.clusterd.tolerations }}
  145. - '--clusterd-toleration={{ toJson $toleration }}'
  146. {{- end }}
  147. {{- end }}
  148. {{- if .Values.balancerd.nodeSelector }}
  149. {{- range $key, $value := .Values.balancerd.nodeSelector }}
  150. - "--balancerd-node-selector={{ $key }}={{ $value }}"
  151. {{- end }}
  152. {{- end }}
  153. {{- if .Values.balancerd.affinity }}
  154. - '--balancerd-affinity={{ toJson .Values.balancerd.affinity }}'
  155. {{- end }}
  156. {{- if .Values.balancerd.tolerations }}
  157. {{- range $toleration := .Values.balancerd.tolerations }}
  158. - '--balancerd-toleration={{ toJson $toleration }}'
  159. {{- end }}
  160. {{- end }}
  161. {{- if .Values.console.nodeSelector }}
  162. {{- range $key, $value := .Values.console.nodeSelector }}
  163. - "--console-node-selector={{ $key }}={{ $value }}"
  164. {{- end }}
  165. {{- end }}
  166. {{- if .Values.console.affinity }}
  167. - '--console-affinity={{ toJson .Values.console.affinity }}'
  168. {{- end }}
  169. {{- if .Values.console.tolerations }}
  170. {{- range $toleration := .Values.console.tolerations }}
  171. - '--console-toleration={{ toJson $toleration }}'
  172. {{- end }}
  173. {{- end }}
  174. {{- if .Values.storage.storageClass.name }}
  175. - "--ephemeral-volume-class={{ .Values.storage.storageClass.name }}"
  176. {{- end }}
  177. {{/* Network Policies */}}
  178. {{- if .Values.networkPolicies.enabled }}
  179. {{- if .Values.networkPolicies.internal.enabled }}
  180. - "--network-policies-internal-enabled"
  181. {{- end }}
  182. {{- if .Values.networkPolicies.ingress.enabled }}
  183. - "--network-policies-ingress-enabled"
  184. {{- range $cidr := .Values.networkPolicies.ingress.cidrs }}
  185. - "--network-policies-ingress-cidrs={{$cidr}}"
  186. {{- end }}
  187. {{- end }}
  188. {{- if .Values.networkPolicies.egress.enabled }}
  189. - "--network-policies-egress-enabled"
  190. {{- range $cidr := .Values.networkPolicies.egress.cidrs }}
  191. - "--network-policies-egress-cidrs={{$cidr}}"
  192. {{- end }}
  193. {{- end }}
  194. {{- end }}
  195. {{- if .Values.tls.defaultCertificateSpecs }}
  196. - '--default-certificate-specs={{ toJson .Values.tls.defaultCertificateSpecs }}'
  197. {{- end }}
  198. {{/* Observability */}}
  199. {{- if .Values.observability.enabled }}
  200. {{- if .Values.observability.podMetrics.enabled }}
  201. - "--collect-pod-metrics"
  202. {{- end }}
  203. {{- if .Values.observability.prometheus.scrapeAnnotations.enabled }}
  204. - "--enable-prometheus-scrape-annotations"
  205. {{- end }}
  206. {{- end }}
  207. {{/* Telemetry */}}
  208. {{- if .Values.telemetry.enabled }}
  209. - "--segment-api-key={{ .Values.telemetry.segmentApiKey }}"
  210. {{- if .Values.telemetry.segmentClientSide }}
  211. - "--segment-client-side"
  212. {{- end }}
  213. {{- end }}
  214. - "--enable-security-context"
  215. {{- if .Values.schedulerName }}
  216. - "--scheduler-name={{ .Values.schedulerName }}"
  217. {{- end }}
  218. {{- if .Values.operator.additionalMaterializeCRDColumns }}
  219. - >
  220. --additional-crd-columns={{ toJson .Values.operator.additionalMaterializeCRDColumns }}
  221. {{- end }}
  222. resources:
  223. {{- toYaml .Values.operator.resources | nindent 10 }}