Managing worker nodes
When making changes to worker nodes, we recommend shifting workloads from them and redistributing the workloads to other healthy nodes in the cluster. This practice prevents outages. The best way to do this is to use the Kubernetes-included operations to drain and cordon the worker nodes.
Draining removes the pods from the targeted node and makes them available to the Kubernetes scheduler for rescheduling. Cordon prevents the node from receiving new pod assignments from the Kubernetes scheduler. After a node is drained and cordoned, you can safely perform maintenance activities.
To drain and cordon worker nodes
To list all the nodes in your cluster, run the following command:
kubectl get nodesIdentify the name of the node you wish to drain.
To cordon a node, run the following command:
kubectl cordon <node name>To drain the node, run the following command:
kubectl drain <node name>- Perform the maintenance activities. For example, perform vMotion or kernel upgrade.
To uncordon a node, run the following command:
kubectl uncordon <node name>When you uncordon the node, it is ready to accept workloads.