Taint eks node-group

1/6/2020

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?

-- Guy Zarzar
amazon-web-services
aws-eks
kubernetes

1 Answer

1/6/2020

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.

-- Sartigan
Source: StackOverflow