I understand one of the EKS node is scheduled for the maintenance. Currently you have second group that runs the "worker" pods and has 3 nodes. You want to scale in the group to 2 nodes and want the node scheduled for the maintenance should are removed as part of scale in. You have workload already transferred to other 2 node at moment.
Below is list of steps I have tested in my test environment to achieve this.
You might already be aware you have autoscaling group for the group and it takes care of launching/termination of node and keep the node count as per you autoscaling desired capacity.
- Drain on EKS:
$ kubectl get nodes
$ kubectl cordon <node name>
$ kubectl drain <node name> --ignore-daemonsets
To terminate the instance and also decrements the size of the Auto Scaling group.
$ aws autoscaling terminate-instance-in-auto-scaling-group --instance-id <INSTANCE_ID> --should-decrement-desired-capacity --region <REGION>
- asked 10 months ago
- Accepted Answerasked a year ago
- AWS OFFICIALUpdated 6 days ago
- AWS OFFICIALUpdated 2 years ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 18 days ago
- EXPERTpublished 4 months ago
- EXPERTpublished 5 months ago