kubernetesamazon-ekseksctl

How to delete decrease the nodes in eksctl kubernetes


I want to delete the single node of cluster

here is my problem i am create the node where 2 nodes are running only but for sometime i need more nodes for few minutes only then after using scaling down i want delete the drain node only from cluster. i do scaling up/down manually
here is the step i follow

  1. create cluster with 2 node
  2. scale up the cluster and add 2 more.
  3. after i want to delete the 2 node with all backup pod only

i tried it with command

eksctl scale nodegroup --cluster= cluster-name --name= name --nodes=4 --nodes-min=1  --nodes-max=4

but it doesn't help it will delete random node also manager will crash.


Solution

  • One option is using a separate node group for the transient load, use taints/tolerations for laod to be scheduled on that node group, drain/delete that particular node group if not needed.

    Do you manually scale up/down nodes? If you are using something like cluster auto scaler, there will be variables like "cluster-autoscaler.kubernetes.io/safe-to-evict": "false" to protect pods from scaling down.