How to set Node status Manually

5/3/2021

I am working on a use case where I need node status Not Ready. I know that node cordon kubectl cordon NODE but this will mark node as Ready,SchedulingDisabled.

For example

kubectl cordon node_id

enter image description here

So is there a way to manually set node status Not Ready in AWS EKS?

enter image description here

-- Adiii
amazon-eks
kubectl
kubernetes

1 Answer

6/19/2021
  1. ssh to worker node and stop kubelet. (SSH to EKS Worker Nodes)

  2. taken from How to simulate nodeNotReady for a node in Kubernetes:


Another way is to overload the Node which will cause: System OOM encountered and that will result in Node NotReady state. This is just one of the ways of how to achieve it: SSH into the Node you want to get into NotReady Install Stress Run stress: stress --cpu 8 --io 4 --hdd 10 --vm 4 --vm-bytes 1024M --timeout 5m (you can adjust the values of course) Wait till Node crash. After you stop the stress the Node should get back to healthy state automatically.

-- Vit
Source: StackOverflow