Steps to Safely Remove a Worker Node from a Kubernetes Cluster
13:02, 04.08.2026
Managing Kubernetes cluster involves lots of activities and definitely, the major one is the proper maintaining of nodes. In some case scenarios, it might be important to remove a worker node from the cluster without interfering with active apps. Thanks to our knowledge of all the practical aspects of this process, we will gladly guide you via the steps needed for the safe removal.
Understanding Kubernetes Clusters
If explaining the Kubernetes cluster in simple words, then this term relates to several nodes (OSs or computers) that function together and communicate with the Kubernetes software.
Defining Nodes in a Kubernetes Cluster
As you’ve understood, the cluster includes a group of nodes and each one is an important element in its design. The cluster can be compared with the team of employees, where every employee is a node. Each node is very important for the specific tasks and has its own storage, memory, and CPU. For the smooth functioning of the apps/services, all the nodes should function accordingly. The nodes are responsible for dealing with everything within the cluster specifically storage management, task completion, and networking management. Kubernetes offers access to more fault-tolerant, scalable, and resilient solutions.
Steps to Gracefully Remove or Delete a Node from a Kubernetes Cluster
Step 1: Start with listing all the available nodes:
kubectl get nodesStep 2: A critical thing before the total removal is the draining so that existing pods will be rescheduled to another node. The following command should be used:
kubectl drain <name-of-the-node>Step 3: Now you can delete it:
kubectl delete node <name-of-the-node>In case, the process has been successfully completed you will see that this node was deleted and other information about its name, status, and way more will be mentioned.
Forcefully Removing a Node from a Kubernetes Cluster
A quick reminder for all who actually want to forcefully remove a node from the cluster – this is not the best variant and is a very radical decision for most of the usage cases. The forceful deletion will definitely affect the entire cluster so try to avoid this process in case possible.
Here are the main steps that are needed for forceful removal of the node:
Step 1: Begin with listing all the available nodes within a specific cluster:
kubectl get nodesStep 2: To start the delete process, you should make sure that no other new pods will be scheduled on this node. To do this you should use the following command:
kubectl cordon <name-of-the-node>Step 3: To make sure that the current workload won’t be influenced, you should also delete all the pods that are on this specific node. This can be done with the following command:
kubectl drain <name-of-the-node> --force --ignore-daemonsetsBy adding force, you are guaranteed that the pods will be removed forcefully.
Step 4: Now you can delete the node with the command:
kubectl delete node <name-of-the-node>
FAQs on Graceful Node Removal in Kubernetes
How Can I Shut Down a Node in Kubernetes?
Prior to deleting the node, you should understand that this step will affect the entire cluster so that should not be done abruptly. It is highly important to start the draining process of the specific node. This means new pods won’t be scheduled and current will be deleted. By doing so, you can be sure that the workload won’t be affected in a negative way.
How Do You Exclude Specific Nodes in Kubernetes?
There are 2 possible options to exclude the nodes in Kubernetes:
- Affinity and node selectors. The node selector is considered to be the easiest way to schedule pods on certain nodes. This variant is great, but one may argue that it has less flexibility if we are talking about complex scheduling. Affinity has more scheduling rules that have both required and preferred constraints.
- Taints and tolerations. This mechanism guarantees that pods won’t be used in the wrong nodes. Tolerations are mentioned in the specification of the pods while taints are in the nodes. A certain node can have one or several taints.