Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to support node selection when using helm install

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.

like image 982
Michael Mirt Avatar asked Sep 24 '18 20:09

Michael Mirt


2 Answers

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.

like image 97
Aadesh Avatar answered Sep 16 '22 20:09

Aadesh


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
like image 20
user9545288 Avatar answered Sep 16 '22 20:09

user9545288