Steps to Safely Remove a Worker Node from a Kubernetes Cluster

watch 3m, 24s
views 2

13:02, 04.08.2026

Article Content
arrow

  • Understanding Kubernetes Clusters
  • Defining Nodes in a Kubernetes Cluster
  • Steps to Gracefully Remove or Delete a Node from a Kubernetes Cluster
  • Forcefully Removing a Node from a Kubernetes Cluster
  • FAQs on Graceful Node Removal in Kubernetes
  • How Can I Shut Down a Node in Kubernetes?
  • How Do You Exclude Specific Nodes in Kubernetes?

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 nodes

Step 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 nodes

Step 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-daemonsets

By 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.

Share

Was this article helpful to you?

VPS popular offers

-10%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
60 GB HDD
Bandwidth
Bandwidth
Unlimited
KVM-HDD 2048 Linux

7.7 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
8 GB
Space
Space
100 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 8192 Windows

28.99 /mo

/mo

Billed annually

-21.5%

CPU
CPU
2 Xeon Cores
RAM
RAM
4 GB
Space
Space
100 GB SSD
Bandwidth
Bandwidth
300 GB
wKVM-SSD 4096 HK Windows

40 /mo

/mo

Billed annually

-10%

CPU
CPU
6 Epyc Cores
RAM
RAM
16 GB
Space
Space
150 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 16384 Linux

50.49 /mo

/mo

Billed annually

-18.4%

CPU
CPU
4 Xeon Cores
RAM
RAM
2 GB
Space
Space
75 GB SSD
Bandwidth
Bandwidth
2 TB
wKVM-SSD 2048 Metered Windows

24 /mo

/mo

Billed annually

-9.7%

CPU
CPU
10 Epyc Cores
RAM
RAM
64 GB
Space
Space
300 GB NVMe
Bandwidth
Bandwidth
Unlimited
wKVM-NVMe 65536 Windows

139.49 /mo

/mo

Billed annually

-10%

CPU
CPU
4 Epyc Cores
RAM
RAM
4 GB
Space
Space
50 GB NVMe
Bandwidth
Bandwidth
Unlimited
KVM-NVMe 4096 Linux

16.45 /mo

/mo

Billed annually

-10%

CPU
CPU
10 Xeon Cores
RAM
RAM
64 GB
Space
Space
300 GB SSD
Bandwidth
Bandwidth
Unlimited
KVM-SSD 65536 Linux

134.99 /mo

/mo

Billed annually

-13.3%

CPU
CPU
2 Xeon Cores
RAM
RAM
1 GB
Space
Space
20 GB SSD
Bandwidth
Bandwidth
300 GB
KVM-SSD 1024 HK Linux

11.33 /mo

/mo

Billed annually

-7.5%

CPU
CPU
3 Xeon Cores
RAM
RAM
1 GB
Space
Space
40 GB HDD
Bandwidth
Bandwidth
300 Gb
KVM-HDD HK 1024 Linux

4.88 /mo

/mo

Billed annually

Other articles on this topic

cookie

Accept cookies & privacy policy?

We use cookies to ensure that we give you the best experience on our website. If you continue without changing your settings, we'll assume that you are happy to receive all cookies on the HostZealot website.