Courseiva

CKA Practice Question: Cluster Architecture, Installation and Configuration

Which command is used to mark a node as unschedulable and evict its pods?

⚠ Common exam trap

CNCF often tests the distinction between `cordon` (only prevents scheduling) and `drain` (prevents scheduling AND evicts pods), and candidates frequently pick `cordon` because they forget that eviction is required for the node to be truly empty for maintenance.

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

`kubectl drain` marks a node as unschedulable (similar to `cordon`) and then evicts all pods from the node, respecting PodDisruptionBudgets. The `--ignore-daemonsets` flag is required because DaemonSet pods cannot be evicted via drain (they are managed by the DaemonSet controller and would be immediately rescheduled on the same node), so the command would fail without this flag.

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 delete node node-name

    Why it's wrong here

    This command completely removes the node object from the Kubernetes API server's registry. It does not perform a graceful eviction of running pods, which can lead to abrupt service disruption as the kubelet stops reporting status and the control plane eventually reschedules the workloads after a timeout.

  • ✗

    kubectl cordon node-name

    Why it's wrong here

    Running this command marks the node as unschedulable by setting its spec.unschedulable field to true, preventing the scheduler from assigning new pods to it. However, it does not evict or migrate any of the existing pods currently running on the node, leaving them active until manually terminated or rescheduled.

  • ✓

    kubectl drain node-name --ignore-daemonsets

    Why this is correct

    This is the correct command because it first cordons the node to prevent new scheduling and then safely evicts all active pods to other nodes in the cluster. The --ignore-daemonsets flag is required because DaemonSet-managed pods cannot be rescheduled elsewhere and would otherwise block the drain operation from completing.

  • ✗

    kubectl taint node node-name key=value:NoSchedule

    Why it's wrong here

    Applying a NoSchedule taint prevents the Kubernetes scheduler from placing any new pods on this node unless they possess a matching toleration. It does not affect or evict any workloads that are already running on the node, making it insufficient for safely emptying a node for maintenance.

About these practice questions

This CKA question is part of Courseiva's 726-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam 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 CKA practice question is part of Courseiva's free CNCF 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 CKA exam.