How to support node selection when using helm install

9/24/2018

Using helm 2.7.3. New to helm and kubernetes. I have two worker nodes, and I want to deploy to a specific node. I've assigned unique labels to each node. I then added nodeSelector to deployment.yaml. When I run helm install it appears to be ignoring the node selection and deploys randomly between the two worker nodes. Would like to understand the best approach to node selection when deploying with helm.

-- Michael Mirt
kubernetes-helm

2 Answers

3/26/2019

See the example:

kubectl label nodes <your desired node> databases=mysql --overwrite

Check the label:

kubectl get nodes  --show-labels

Run the following command:

helm create test-chart && cd test-chart
helm install . --set nodeSelector.databases=mysql
-- user9545288
Source: StackOverflow

11/15/2019

You can use something like this:

helm install --name elasticsearch elastic/elasticsearch --set \
 nodeSelector."beta\\.kubernetes\\.io/os"=linux

Note: Escaping . character! Hope this helps.

-- Aadesh
Source: StackOverflow