From c439190a8e9ba9f78981964a0fa5ed4d5b0ea462 Mon Sep 17 00:00:00 2001 From: ericsyh Date: Mon, 2 Dec 2024 15:02:44 +0800 Subject: [PATCH 1/3] feat: support rackAwareTopologyLabels field on bk Signed-off-by: ericsyh --- .../templates/bookkeeper/bookkeeper-cluster.yaml | 4 ++++ charts/sn-platform-slim/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml index e35f8950..08deac0f 100644 --- a/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform-slim/templates/bookkeeper/bookkeeper-cluster.yaml @@ -151,6 +151,10 @@ spec: reclaimPolicy: {{ .Values.bookkeeper.volumes.reclaimPolicy | default "Delete" }} {{- end }} config: + {{- with .Values.bookkeeper.rackAwareTopologyLabels }} + rackAwareTopologyLabels: + {{- toYaml . | nindent 4 }} + {{- end }} custom: {{- with .Values.bookkeeper.custom }} {{ toYaml . | indent 6 }} diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 5bf2d1ce..30e1e2d6 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -826,6 +826,10 @@ bookkeeper: # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution topologySpreadConstraints: [] + # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. + # When there are multiple labels configured, all their values will be joined by "/". + # The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically. + rackAwareTopologyLabels: [] labels: {} annotations: {} securityContext: From 173932b58e6870ec41bf9fd069cc1146e72bc8aa Mon Sep 17 00:00:00 2001 From: ericsyh Date: Mon, 2 Dec 2024 15:06:38 +0800 Subject: [PATCH 2/3] support on the rackAwareTopologyLabels on sn-plaform chart Signed-off-by: ericsyh --- .../sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml | 4 ++++ charts/sn-platform/values.yaml | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml index 8f1c1b40..0c1057c8 100644 --- a/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml +++ b/charts/sn-platform/templates/bookkeeper/bookkeeper-cluster.yaml @@ -151,6 +151,10 @@ spec: reclaimPolicy: {{ .Values.bookkeeper.volumes.reclaimPolicy | default "Delete" }} {{- end }} config: + {{- with .Values.bookkeeper.rackAwareTopologyLabels }} + rackAwareTopologyLabels: + {{- toYaml . | nindent 4 }} + {{- end }} custom: {{- with .Values.bookkeeper.custom }} {{ toYaml . | indent 6 }} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index f1b49c36..f3c7700d 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -901,6 +901,10 @@ bookkeeper: # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution topologySpreadConstraints: [] + # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. + # When there are multiple labels configured, all their values will be joined by "/". + # The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically. + rackAwareTopologyLabels: [] labels: {} annotations: {} securityContext: From 1bd404371e1e4591bf91b5a2c127c6392401361c Mon Sep 17 00:00:00 2001 From: ericsyh Date: Mon, 2 Dec 2024 15:11:50 +0800 Subject: [PATCH 3/3] fix lint Signed-off-by: ericsyh --- charts/sn-platform-slim/values.yaml | 4 ++-- charts/sn-platform/values.yaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/sn-platform-slim/values.yaml b/charts/sn-platform-slim/values.yaml index 30e1e2d6..40134203 100644 --- a/charts/sn-platform-slim/values.yaml +++ b/charts/sn-platform-slim/values.yaml @@ -826,8 +826,8 @@ bookkeeper: # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution topologySpreadConstraints: [] - # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. - # When there are multiple labels configured, all their values will be joined by "/". + # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. + # When there are multiple labels configured, all their values will be joined by "/". # The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically. rackAwareTopologyLabels: [] labels: {} diff --git a/charts/sn-platform/values.yaml b/charts/sn-platform/values.yaml index f3c7700d..bafe6e0d 100644 --- a/charts/sn-platform/values.yaml +++ b/charts/sn-platform/values.yaml @@ -901,8 +901,8 @@ bookkeeper: # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to enforce but not guranentee type: preferredDuringSchedulingIgnoredDuringExecution topologySpreadConstraints: [] - # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. - # When there are multiple labels configured, all their values will be joined by "/". + # For BookKeeperCluster, the field rackAwareTopologyLabels should be configured as nodes topology labels the value of which will be set as the rack name. + # When there are multiple labels configured, all their values will be joined by "/". # The operator will propagate the label value from nodes to pods and ensure the pod container starts with the label values as environment variables automatically. rackAwareTopologyLabels: [] labels: {}