From 8b42a61f2e5409da0c2c53d8542303b932cdae94 Mon Sep 17 00:00:00 2001 From: Aliaksandr Shulyak Date: Fri, 14 Oct 2022 13:44:47 -0500 Subject: [PATCH] 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 * Fix typo in values Co-authored-by: Michael Marshall ### 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: ""