# Configuration parameter syntax for nodeSelector?

**URL:** <https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528>\
**Category:** Elastic Cloud on Kubernetes (ECK)\
**Created:** [March 6, 2020, 11:45pm UTC](https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528 "2020-03-06T23:45:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielP1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielp1/32/73483_2.png) [@danielP1](https://discuss.elastic.co/u/danielP1)\
**Post date:** [March 6, 2020, 11:45pm UTC](https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528/1 "2020-03-06T23:45:01Z")

</div>

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

> **[elastic/helm-charts](https://github.com/elastic/helm-charts/tree/master/elasticsearch)**
>
> You know, for Kubernetes. Contribute to elastic/helm-charts development by creating an account on GitHub.

  
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.

---

<div class="post-metadata">

**Author:** ![dkow](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dkow/32/47340_2.png) [@dkow](https://discuss.elastic.co/u/dkow)\
**Post date:** [March 11, 2020, 7:33am UTC](https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528/2 "2020-03-11T07:33:51Z")

</div>

Hi @danielP1, thanks for your question. This forum is mostly for ECK ([https://github.com/elastic/cloud-on-k8s](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?

```auto
$ 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

```

---

<div class="post-metadata">

**Author:** ![danielP1](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/danielp1/32/73483_2.png) [@danielP1](https://discuss.elastic.co/u/danielP1)\
**Post date:** [March 11, 2020, 5:17pm UTC](https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528/3 "2020-03-11T17:17:13Z")

</div>

@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**

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [November 4, 2022, 7:48am UTC](https://discuss.elastic.co/t/configuration-parameter-syntax-for-nodeselector/222528/4 "2022-11-04T07:48:15Z")

</div>


