0

I am running an EKS cluster with several node groups and I am trying to find a way to remove a specific worker node (EC2 machine) from one of the node group.

I have drained and taint the node. however, I cannot find a way to remove it specifically from the node group.

with eksctl, I can only specify the desired number of nodes, but I do not know if it will intelligently remove the tainted node for me, or it will randomly remove one in specified node group.

eksctl scale nodegroup --cluster=prod --nodes=8 --name=worker

If this is not possible, Any idea on how to safely reduce number of worker node?

Thank you

  • I have just found a good solution from https://stackoverflow.com/questions/51829815/how-to-gracefully-drain-a-node-in-eks. basically we can use `aws autoscaling terminate-instance-in-auto-scaling-group --instance-id --should-decrement-desired-capacity --p ` which can achieve everything I want – Tanat Lokejaroenlarb Sep 06 '21 at 03:24
  • also, beware that EKS will automatically rebalance number of nodes in availability zones. in my case, after running the command, it took the desired node out of the group and decrease capacity from asg. however, after a few minutes, EKS automatically added a new node for `availability zones ap-southeast-1a ap-southeast-1c had 4 2 instances respectively. An instance was launched to aid in balancing the group's zones` then it automatically selected one of the node to remove to balance the number. which in this case, is not safe for me. because I did not cordon/drain the lucky node :( – Tanat Lokejaroenlarb Sep 06 '21 at 03:47

0 Answers0