This is an automated email from the ASF dual-hosted git repository.

lhotari pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-helm-chart.git


The following commit(s) were added to refs/heads/master by this push:
     new 042fd5b  Configure custom topologyKey for podAntiAffinity (#351)
042fd5b is described below

commit 042fd5b6d47565747dbbc169419f9a0c73d227be
Author: Tomasz Jegorow <[email protected]>
AuthorDate: Wed Jul 12 17:19:49 2023 +0200

    Configure custom topologyKey for podAntiAffinity (#351)
---
 charts/pulsar/templates/autorecovery-statefulset.yaml | 4 ++--
 charts/pulsar/templates/bookkeeper-statefulset.yaml   | 4 ++--
 charts/pulsar/templates/broker-statefulset.yaml       | 4 ++--
 charts/pulsar/templates/proxy-statefulset.yaml        | 4 ++--
 charts/pulsar/templates/zookeeper-statefulset.yaml    | 4 ++--
 charts/pulsar/values.yaml                             | 5 +++++
 6 files changed, 15 insertions(+), 10 deletions(-)

diff --git a/charts/pulsar/templates/autorecovery-statefulset.yaml 
b/charts/pulsar/templates/autorecovery-statefulset.yaml
index 358afe5..6c48f40 100644
--- a/charts/pulsar/templates/autorecovery-statefulset.yaml
+++ b/charts/pulsar/templates/autorecovery-statefulset.yaml
@@ -81,7 +81,7 @@ spec:
                 operator: In
                 values:
                 - {{ .Values.autorecovery.component }}
-            topologyKey: "kubernetes.io/hostname"
+            topologyKey: {{ 
.Values.autorecovery.affinity.anti_affinity_topology_key }}
         {{ else }}
           {{ .Values.autorecovery.affinity.type }}:
             - weight: 100
@@ -100,7 +100,7 @@ spec:
                       operator: In
                       values:
                       - {{ .Values.autorecovery.component }}
-                topologyKey: "kubernetes.io/hostname"
+                topologyKey: {{ 
.Values.autorecovery.affinity.anti_affinity_topology_key }}
         {{ end }}
         {{- end }}
       terminationGracePeriodSeconds: {{ .Values.autorecovery.gracePeriod }}
diff --git a/charts/pulsar/templates/bookkeeper-statefulset.yaml 
b/charts/pulsar/templates/bookkeeper-statefulset.yaml
index 7ea55f3..9fd44ab 100644
--- a/charts/pulsar/templates/bookkeeper-statefulset.yaml
+++ b/charts/pulsar/templates/bookkeeper-statefulset.yaml
@@ -78,7 +78,7 @@ spec:
                 operator: In
                 values:
                 - {{ .Values.bookkeeper.component }}
-            topologyKey: "kubernetes.io/hostname"
+            topologyKey: {{ 
.Values.bookkeeper.affinity.anti_affinity_topology_key }}
         {{ else }}
           {{ .Values.bookkeeper.affinity.type }}:
             - weight: 100
@@ -97,7 +97,7 @@ spec:
                       operator: In
                       values:
                       - {{ .Values.bookkeeper.component }}
-                topologyKey: "kubernetes.io/hostname"
+                topologyKey: {{ 
.Values.bookkeeper.affinity.anti_affinity_topology_key }}
         {{ end }}
         {{- end }}
       terminationGracePeriodSeconds: {{ .Values.bookkeeper.gracePeriod }}
diff --git a/charts/pulsar/templates/broker-statefulset.yaml 
b/charts/pulsar/templates/broker-statefulset.yaml
index c8e59fc..ddbc9a2 100644
--- a/charts/pulsar/templates/broker-statefulset.yaml
+++ b/charts/pulsar/templates/broker-statefulset.yaml
@@ -81,7 +81,7 @@ spec:
                 operator: In
                 values:
                 - {{ .Values.broker.component }}
-            topologyKey: "kubernetes.io/hostname"
+            topologyKey: {{ .Values.broker.affinity.anti_affinity_topology_key 
}}
         {{ else }}
           {{ .Values.broker.affinity.type }}:
             - weight: 100
@@ -100,7 +100,7 @@ spec:
                       operator: In
                       values:
                       - {{ .Values.broker.component }}
-                topologyKey: "kubernetes.io/hostname"
+                topologyKey: {{ 
.Values.broker.affinity.anti_affinity_topology_key }}
         {{ end }}
         {{- end }}
       terminationGracePeriodSeconds: {{ .Values.broker.gracePeriod }}
diff --git a/charts/pulsar/templates/proxy-statefulset.yaml 
b/charts/pulsar/templates/proxy-statefulset.yaml
index 5a284f5..756253d 100644
--- a/charts/pulsar/templates/proxy-statefulset.yaml
+++ b/charts/pulsar/templates/proxy-statefulset.yaml
@@ -80,7 +80,7 @@ spec:
                 operator: In
                 values:
                 - {{ .Values.proxy.component }}
-            topologyKey: "kubernetes.io/hostname"
+            topologyKey: {{ .Values.proxy.affinity.anti_affinity_topology_key 
}}
         {{ else }}
           {{ .Values.proxy.affinity.type }}:
             - weight: 100
@@ -99,7 +99,7 @@ spec:
                       operator: In
                       values:
                       - {{ .Values.proxy.component }}
-                topologyKey: "kubernetes.io/hostname"
+                topologyKey: {{ 
.Values.proxy.affinity.anti_affinity_topology_key }}
         {{ end }}
         {{- end }}
       terminationGracePeriodSeconds: {{ .Values.proxy.gracePeriod }}
diff --git a/charts/pulsar/templates/zookeeper-statefulset.yaml 
b/charts/pulsar/templates/zookeeper-statefulset.yaml
index 2f0204d..739f617 100644
--- a/charts/pulsar/templates/zookeeper-statefulset.yaml
+++ b/charts/pulsar/templates/zookeeper-statefulset.yaml
@@ -77,7 +77,7 @@ spec:
                 operator: In
                 values:
                 - {{ .Values.zookeeper.component }}
-            topologyKey: "kubernetes.io/hostname"
+            topologyKey: {{ 
.Values.zookeeper.affinity.anti_affinity_topology_key }}
         {{ else }}
           {{ .Values.zookeeper.affinity.type }}:
             - weight: 100
@@ -96,7 +96,7 @@ spec:
                       operator: In
                       values:
                       - {{ .Values.zookeeper.component }}
-                topologyKey: "kubernetes.io/hostname"
+                topologyKey: {{ 
.Values.zookeeper.affinity.anti_affinity_topology_key }}
         {{ end }}
         {{- end }}
       terminationGracePeriodSeconds: {{ .Values.zookeeper.gracePeriod }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index a1d410a..f347d2f 100644
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -321,6 +321,7 @@ zookeeper:
       timeoutSeconds: 30
   affinity:
     anti_affinity: true
+    anti_affinity_topology_key: kubernetes.io/hostname
     # Set the anti affinity type. Valid values:
     # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for 
pod to be scheduled (hard) requires at least one node per replica
     # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to 
enforce but not guranentee
@@ -459,6 +460,7 @@ bookkeeper:
       timeoutSeconds: 5
   affinity:
     anti_affinity: true
+    anti_affinity_topology_key: kubernetes.io/hostname
     # Set the anti affinity type. Valid values:
     # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for 
pod to be scheduled (hard) requires at least one node per replica
     # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to 
enforce but not guranentee
@@ -615,6 +617,7 @@ autorecovery:
     # cloud.google.com/gke-nodepool: default-pool
   affinity:
     anti_affinity: true
+    anti_affinity_topology_key: kubernetes.io/hostname
     # Set the anti affinity type. Valid values:
     # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for 
pod to be scheduled (hard) requires at least one node per replica
     # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to 
enforce but not guranentee
@@ -715,6 +718,7 @@ broker:
       timeoutSeconds: 5
   affinity:
     anti_affinity: true
+    anti_affinity_topology_key: kubernetes.io/hostname
     # Set the anti affinity type. Valid values:
     # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for 
pod to be scheduled (hard) requires at least one node per replica
     # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to 
enforce but not guranentee
@@ -842,6 +846,7 @@ proxy:
       timeoutSeconds: 5
   affinity:
     anti_affinity: true
+    anti_affinity_topology_key: kubernetes.io/hostname
     # Set the anti affinity type. Valid values:
     # requiredDuringSchedulingIgnoredDuringExecution - rules must be met for 
pod to be scheduled (hard) requires at least one node per replica
     # preferredDuringSchedulingIgnoredDuringExecution - scheduler will try to 
enforce but not guranentee

Reply via email to