From 8f033bd1a5eba6a844343325b090a72a7b253e61 Mon Sep 17 00:00:00 2001 From: Samuel Verstraete Date: Thu, 20 Oct 2022 06:41:39 +0200 Subject: [PATCH] allow specifying the nodeSelector for the init jobs (#225) * allow specifying the nodeSelector for the init jobs * Use pulsar_metadata.nodeSelector Co-authored-by: samuel ### Motivation When deploying pulsar to an AKS cluster with windows nodepools i was unable to specify that the Jobs of the initalize release had to run on linux nodes. With the change i can now specify a node selector for the init jobs. ### Modifications add nodeSelector on pulsar_init and bookie_init ### Verifying this change - [ ] Make sure that the change passes the CI checks. --- charts/pulsar/templates/bookkeeper-cluster-initialize.yaml | 4 ++++ charts/pulsar/templates/pulsar-cluster-initialize.yaml | 5 ++++- charts/pulsar/values.yaml | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml index 24f455f..928ddcf 100644 --- a/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml +++ b/charts/pulsar/templates/bookkeeper-cluster-initialize.yaml @@ -37,6 +37,10 @@ spec: {{- if and .Values.rbac.enabled .Values.rbac.psp }} serviceAccountName: "{{ template "pulsar.fullname" . }}-{{ .Values.bookkeeper.component }}" {{- end }} + nodeSelector: + {{- if .Values.pulsar_metadata.nodeSelector }} +{{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }} + {{- end }} initContainers: - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.images.bookie "root" .) }}" diff --git a/charts/pulsar/templates/pulsar-cluster-initialize.yaml b/charts/pulsar/templates/pulsar-cluster-initialize.yaml index 224d08a..0c71824 100644 --- a/charts/pulsar/templates/pulsar-cluster-initialize.yaml +++ b/charts/pulsar/templates/pulsar-cluster-initialize.yaml @@ -35,6 +35,10 @@ spec: {{- end }} template: spec: + {{- if .Values.pulsar_metadata.nodeSelector }} + nodeSelector: +{{ toYaml .Values.pulsar_metadata.nodeSelector | indent 8 }} + {{- end }} initContainers: {{- if .Values.pulsar_metadata.configurationStore }} - name: wait-cs-ready @@ -46,7 +50,6 @@ spec: until nslookup {{ .Values.pulsar_metadata.configurationStore}}; do sleep 3; done; - {{- end }} - name: wait-zookeeper-ready image: "{{ template "pulsar.imageFullName" (dict "image" .Values.pulsar_metadata.image "root" .) }}" diff --git a/charts/pulsar/values.yaml b/charts/pulsar/values.yaml index 2645c4b..9d7df5e 100644 --- a/charts/pulsar/values.yaml +++ b/charts/pulsar/values.yaml @@ -644,6 +644,9 @@ pulsar_metadata: # configurationStore: configurationStoreMetadataPrefix: "" configurationStorePort: 2181 + ## optional you can specify a nodeSelector for all init jobs (pulsar-init & bookkeeper-init) + # nodeSelector: + # cloud.google.com/gke-nodepool: default-pool ## optional, you can provide your own zookeeper metadata store for other components # to use this, you should explicit set components.zookeeper to false