Configuration parameter syntax for nodeSelector?

Greetings,
I'm attempting to deploy elasticsearch onto k8s with the elasticsearch helm chart:


I would like to constrain on which nodes the elastisearch components run.
I see in the documentation there is a configuration parameter client.nodeselector and the default value is {}.

Do I assume correctly that I can pass in key value pairs to constrain elasticsearch to only run on nodes with those label pairs, similar to how nodeSelector is used in a Deployment?

For example, to run on all nodes with a env=dev label, I tried `{ "env": "dev"} when I deployed, but certain components are running on nodes that don't have this label, so perhaps I'm getting the syntax wrong.

What is the proper syntax to do this? And, in general, is there some documentation somewhere that specifies how syntax should look for values specified under configuration parameters? e.g. what would values for [] vs {} look like, etc.

Hi @danielP1, thanks for your question. This forum is mostly for ECK (https://github.com/elastic/cloud-on-k8s) questions, which is different from elastic/helm-charts, but I'll take a stab at answering anyway.

I think your assumptions are correct. I think there is nothing specific to the elastic charts themselves and you'd use the same syntax as for any other helm charts.

Have you tried something similar to below? Is that what you needed?

$ cat values.yml
nodeSelector:
  env: dev
$ helm install --name elasticsearch elastic/elasticsearch --values ./values.yml
...
$ kubectl describe pod elasticsearch-master-0 | grep Node-Sel
Node-Selectors:  env=dev

@dkow sorry to post to the wrong group, and thanks for your response.

I ended up specifying nodeSelector on the cli and it worked great:

helm install elasticsearch . -n namespace42 --set nodeSelector.env=dev