From f5fde78e3c49ce4bbdcaa7d6a4cd0921e1003027 Mon Sep 17 00:00:00 2001 From: Lidor Ettinger Date: Tue, 23 Jul 2024 00:04:47 +0300 Subject: [PATCH] Update helm chart to all adding topologySpreadConstraints Signed-off-by: Lidor Ettinger --- deploy/helm/clickhouse-operator/README.md | 1 + .../templates/generated/Deployment-clickhouse-operator.yaml | 1 + deploy/helm/clickhouse-operator/values.yaml | 3 +++ dev/generate_helm_chart.sh | 1 + 4 files changed, 6 insertions(+) diff --git a/deploy/helm/clickhouse-operator/README.md b/deploy/helm/clickhouse-operator/README.md index b35045542..e2fd38705 100644 --- a/deploy/helm/clickhouse-operator/README.md +++ b/deploy/helm/clickhouse-operator/README.md @@ -52,6 +52,7 @@ For upgrade please install CRDs separately: | podAnnotations | object | `{"clickhouse-operator-metrics/port":"9999","clickhouse-operator-metrics/scrape":"true","prometheus.io/port":"8888","prometheus.io/scrape":"true"}` | annotations to add to the clickhouse-operator pod, look `kubectl explain pod.spec.annotations` for details | | podLabels | object | `{}` | labels to add to the clickhouse-operator pod | | podSecurityContext | object | `{}` | | +| topologySpreadConstraints | list | `[]` | Topology spread constraints rely on node labels to identify the topology domain(s) that each Node is in. # Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/ # | | rbac.create | bool | `true` | specifies whether cluster roles and cluster role bindings should be created | | secret.create | bool | `true` | create a secret with operator credentials | | secret.password | string | `"clickhouse_operator_password"` | operator credentials password | diff --git a/deploy/helm/clickhouse-operator/templates/generated/Deployment-clickhouse-operator.yaml b/deploy/helm/clickhouse-operator/templates/generated/Deployment-clickhouse-operator.yaml index a6c5ddb51..2b95980d2 100644 --- a/deploy/helm/clickhouse-operator/templates/generated/Deployment-clickhouse-operator.yaml +++ b/deploy/helm/clickhouse-operator/templates/generated/Deployment-clickhouse-operator.yaml @@ -193,3 +193,4 @@ spec: affinity: {{ toYaml .Values.affinity | nindent 8 }} tolerations: {{ toYaml .Values.tolerations | nindent 8 }} securityContext: {{ toYaml .Values.podSecurityContext | nindent 8 }} + topologySpreadConstraints: {{ toYaml .Values.topologySpreadConstraints | nindent 8 }} diff --git a/deploy/helm/clickhouse-operator/values.yaml b/deploy/helm/clickhouse-operator/values.yaml index f39509858..0e189e7b0 100644 --- a/deploy/helm/clickhouse-operator/values.yaml +++ b/deploy/helm/clickhouse-operator/values.yaml @@ -114,6 +114,9 @@ affinity: {} # podSecurityContext - operator deployment SecurityContext, look `kubectl explain pod.spec.securityContext` for details podSecurityContext: {} +# topologySpreadConstraints - topologySpreadConstraints affinity for scheduler pod assignment, look `kubectl explain pod.spec.topologySpreadConstraints` for details + +topologySpreadConstraints: [] serviceMonitor: # serviceMonitor.enabled -- ServiceMonitor Custom resource is created for a (prometheus-operator)[https://github.com/prometheus-operator/prometheus-operator] enabled: false diff --git a/dev/generate_helm_chart.sh b/dev/generate_helm_chart.sh index b8c71035e..76500c829 100755 --- a/dev/generate_helm_chart.sh +++ b/dev/generate_helm_chart.sh @@ -190,6 +190,7 @@ function update_deployment_resource() { yq e -i '.spec.template.spec.affinity |= "{{ toYaml .Values.affinity | nindent 8 }}"' "${file}" yq e -i '.spec.template.spec.tolerations |= "{{ toYaml .Values.tolerations | nindent 8 }}"' "${file}" yq e -i '.spec.template.spec.securityContext |= "{{ toYaml .Values.podSecurityContext | nindent 8 }}"' "${file}" + yq e -i '.spec.template.spec.topologySpreadConstraints |= "{{ toYaml .Values.topologySpreadConstraints | nindent 8 }}"' "${file}" for cm in $(yq e '.spec.template.spec.volumes[].configMap.name' "${file}"); do local prefix='{{ include \"altinity-clickhouse-operator.fullname\" . }}'