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

mmarshall 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 8b42a61  Add nodeSelector to cluster initialize pod (#284)
8b42a61 is described below

commit 8b42a61f2e5409da0c2c53d8542303b932cdae94
Author: Aliaksandr Shulyak <[email protected]>
AuthorDate: Fri Oct 14 13:44:47 2022 -0500

    Add nodeSelector to cluster initialize pod (#284)
    
    * Add nodeSelector to cluster initialize pod
    
    * Add option to values file
    
    * Update charts/pulsar/templates/pulsar-cluster-initialize.yaml
    
    Co-authored-by: Michael Marshall <[email protected]>
    
    * Fix typo in values
    
    Co-authored-by: Michael Marshall <[email protected]>
    
    ### Motivation
    
    Add an option to choose where to run pulsar-cluster-initialize pod. 
Sometimes there is a necessity to run only on certain nodes.
    
    ### Modifications
    
    Added nodeSelector option to the pulsar-cluster-initialize job.
---
 charts/pulsar/templates/pulsar-cluster-initialize.yaml | 4 ++++
 charts/pulsar/values.yaml                              | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml 
b/charts/pulsar/templates/pulsar-cluster-initialize.yaml
index 0b9b77a..c9842d7 100644
--- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml
+++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml
@@ -114,5 +114,9 @@ spec:
       volumes:
       {{- include "pulsar.toolset.certs.volumes" . | nindent 6 }}
       restartPolicy: OnFailure
+      {{- if .Values.pulsar_metadata.nodeSelector }}
+      nodeSelector:
+{{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }}
+      {{- end }}
 {{- end }}
 {{- end }}
diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml
index 0f287dd..95bb18e 100644
--- a/charts/pulsar/values.yaml
+++ b/charts/pulsar/values.yaml
@@ -663,6 +663,9 @@ pulsar_metadata:
   # to use this, you should explicit set components.zookeeper to false
   #
   # userProvidedZookeepers: "zk01.example.com:2181,zk02.example.com:2181"
+  
+  ## optional, you can specify where to run pulsar-cluster-initialize job
+  # nodeSelector:
 
 # Can be used to run extra commands in the initialization jobs e.g. to quit 
istio sidecars etc.
 extraInitCommand: ""

Reply via email to