Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Taint eks node-group

I have a cluster with 2 node groups: real time and general. I would like only pods which tolerate affinity real time to be able to run on nodes from the real time cluster. My approach was to taint the relevant nodes and add toleration to the pod that I want to register to that node. I came into a dead-end when I was trying to taint a node-group. In my case I have an EKS node group that is elastic, i.e. nodes are increasing and decreasing in numbers constantly. How can I configure the group so that nodes from one group will be tainted upon creation?

like image 214
Guy Zarzar Avatar asked Mar 02 '23 23:03

Guy Zarzar


1 Answers

I assume you're creating your nodeGroup via CloudFormation?

If that is the case you can add --kubelet-extra-args --register-with-taints={key}={value}:NoSchedule as your ${BootstrapArguments} for your LaunchConfig

/etc/eks/bootstrap.sh ${clusterName} ${BootstrapArguments}

That way, whenever you scale up or down your cluster, a Node will be spawned with the appropriate taint.

like image 130
Sartigan Avatar answered Mar 05 '23 16:03

Sartigan