InterviewSolution
| 1. |
How do you drain the traffic from a Pod during maintenance? |
|
Answer» When we take the node for maintenance, PODS inside the nodes also take a hit. However, we can avoid it by using the below command kubectl drain <nodename>When we run the above command it marks the node unschedulable for newer pods then the existing pods are evicted if the API Server supports EVICTION else it deletes the pods Once the node is up and running and you want to add it in rotation we can run the below command kubectl uncordon <nodename>Note: If you prefer not to use kubectl drain (such as to avoid calling to an external command, or to get finer control over the pod eviction PROCESS), you can also programmatically cause EVICTIONS using the eviction API. More info: https://Kubernetes.io/docs/tasks/administer-cluster/safely-drain-node/ |
|