Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

How GKE performs drain when deleting a node from the cluster?

I would like to understand what kind of drain does gke perform at the time of node deletion. does it use --ignore-daemonset or --force options ? is there any wait any for node removal case.

0 1 1,092
1 REPLY 1

Hi @subithal,

Welcome to the Google Cloud Community!

Google Kubernetes Engine (GKE) should perform node draining in the same manner as native Kubernetes.

I conducted the following experiment in my console. Consider a GKE standard cluster with three nodes. Each node has an empty pod deployed from a deployment manifest and another pod deployed by a DaemonSet manifest. Let's designate these nodes as Node A, Node B, and Node C.

Node A - gke-cluster-1-default-pool-790db6e2-dz9l

Node B - gke-cluster-1-default-pool-790db6e2-lv8j

Node C - gke-cluster-1-default-pool-790db6e2-rz33

Node A - Running the command k drain gke-cluster-1-default-pool-790db6e2-dz9l
Result: Both pods remain undeleted. As depicted in the accompanying image, an error will occur.

TestCase1.png

Node B - Running the command k drain gke-cluster-1-default-pool-790db6e2-lv8j --ignore-daemonsets --delete-emptydir-data
Result: The pod deployed by the Deployment manifest is deleted, while the pod created by the DaemonSet is ignored.

TestCase2.png

Node C - Running the command k drain gke-cluster-1-default-pool-790db6e2-rz33 --force
Result: Both pods remain undeleted. The same error is received as without the --force flag.

TestCase3.png

I hope this answers your question. Thank you. 😃

Top Labels in this Space
Top Solution Authors