Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution
You need to drain a GKE node for maintenance. The node is running a DaemonSet and some pods with emptyDir volumes. Which kubectl command should you use to safely drain the node without causing errors?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
kubectl drain node-name --ignore-daemonsets --delete-emptydir-data
The kubectl drain command with --ignore-daemonsets and --delete-emptydir-data flags safely evicts pods while ignoring DaemonSets (which are managed by the node) and allowing deletion of pods with emptyDir volumes.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
kubectl drain node-name --force
Why it's wrong here
The --force flag only bypasses the safety check for pods that are not managed by a controller (bare pods) and does not specifically handle DaemonSet pods or pods using emptyDir volumes. Because the node in this scenario runs DaemonSet pods and workloads with emptyDir data, kubectl drain will still block on those conditions unless the matching flags are provided. Instead of force-skipping protections, use the explicit flags designed for those workload types.
- ✓
kubectl drain node-name --ignore-daemonsets --delete-emptydir-data
Why this is correct
This is the correct drain command because --ignore-daemonsets tells kubectl to skip evicting Pods that are managed by DaemonSets (they would just be recreated on the same node), and --delete-emptydir-data lets the drain proceed even if Pods have emptyDir volumes that will be lost. The drain cordons the node, then gracefully evicts remaining workload Pods while honoring PodDisruptionBudgets, making it safe for planned maintenance. These flags are the standard pair used when a GKE node contains DaemonSets and emptyDir-backed pods.
- ✗
kubectl drain node-name --ignore-daemonsets
Why it's wrong here
The --ignore-daemonsets flag addresses only the DaemonSet problem. If any pod on the node uses an emptyDir volume, kubectl drain will abort with an error indicating that local storage data would be deleted and requires --delete-emptydir-data. Without that second flag, the drain fails before maintenance can complete, so this one-flag command is insufficient.
- ✗
kubectl cordon node-name && kubectl delete pods --all --grace-period=0
Why it's wrong here
Cordoning only makes the node unschedulable, and kubectl delete pods --all removes every pod from the current namespace, not those scheduled to the specific node, so this command is not equivalent to draining. Using --grace-period=0 force-deletes pods immediately, bypassing graceful termination and PodDisruptionBudget checks, which can cause downtime and is unsafe for planned maintenance. A proper drain evicts pods per PDB and lets them reschedule onto healthy nodes.
Go deeper
Related to this question
About these practice questions
One of 769 original ACE practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.