From the course: Certified Kubernetes Administrator (CKA) Cert Prep

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

Managing node state

Managing node state

- In this video, we'll talk about managing node state. Normally, your Kubernetes nodes are operational, but sometimes you need to do maintenance and then you might be interested in managing the node state. So what are your options? To start with, there is kubectl cordon, that is what you use to mark a node as unschedulable, that means that Pods currently are running on the node are left alone, no new Pods will be started. Kubectl drain is a little bit more intense. It is used to mark a node as unschedulable and removes all running Pods from it. You will notice that in order to drain a node, some additional work might be needed. Like Pods that have been started from a DaemonSet, normally these are the agents, they will not be remove. while using kubectl drain and if you want to remove them as well, you need "--ignore-daemonsets". And also if you have any Pod volumes of the type "emptydir", these emptydir volumes are stored on the current node as well, and to force them to go away, you…

Contents