Courseiva
Ensuring Successful Operation of a Cloud SolutionmediumMultiple SelectObjective-mapped

Google ACE Practice Question: Ensuring Successful Operation of a Cloud Solution

You need to drain a GKE node for maintenance without disrupting running workloads that are managed by a DaemonSet. Which TWO flags should you use with kubectl drain? (Choose two.)

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

--delete-emptydir-data

kubectl drain evicts pods. By default, it will fail if there are pods not managed by a ReplicationController/ReplicaSet/Deployment or if there are DaemonSet pods. The --ignore-daemonsets flag allows draining despite DaemonSet pods. The --delete-emptydir-data flag is needed if any pods use 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.

  • --delete-emptydir-data

    Why this is correct

    This flag allows the eviction of pods that use emptyDir volumes. During a node drain, kubectl will not evict such pods by default because their data is ephemeral and would be lost. To proceed with draining and terminate these pods gracefully, you must explicitly permit the deletion of their emptyDir data. This is safe when you don't need the temporary data or when apps handle empty volumes on startup.

  • --grace-period=0

    Why it's wrong here

    This flag sets the termination grace period to zero seconds, meaning that after the termination signal, the pod is immediately killed with SIGKILL. This defeats the purpose of a graceful drain because containers get no time to shut down cleanly, potentially disrupting active connections or losing state. The correct approach is to use the default grace period or a value that fits your application's shutdown sequence.

  • --disable-eviction

    Why it's wrong here

    This flag does not exist in the kubectl drain command. The valid flags include --delete-emptydir-data, --force, --ignore-daemonsets, --grace-period, and --pod-selector, among others. Running `kubectl drain` with a non-existent flag will result in an error and no drain will occur. Always verify available options with `kubectl drain --help`.

  • --ignore-daemonsets

    Why this is correct

    DaemonSet pods are managed by the DaemonSet controller and are expected to run on every node. When you drain a node, kubectl refuses to evict DaemonSet pods unless you explicitly pass --ignore-daemonsets. This flag allows the drain to proceed by ignoring those pods, assuming the DaemonSet controller will reschedule them as needed. Without it, the drain would be blocked.

  • --force

    Why it's wrong here

    The --force flag is required when draining a node that contains pods not managed by a controller, such as standalone pods. Since the workloads here are managed by a DaemonSet, they are controlled and --force is unnecessary. Using --force indiscriminately can bypass safety checks and lead to data loss or unintended evictions, so it should only be used when truly needed.

About these practice questions

Courseiva writes every ACE question from scratch — 769 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

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.