Courseiva

CKA Practice Question: Cluster Architecture, Installation and Configuration

An administrator runs 'kubectl cordon node1' and then 'kubectl drain node1 --ignore-daemonsets'. What is the effect on node1?

⚠ Common exam trap

It's easy for candidates to confuse `cordon` (which only marks the node unschedulable) with `drain` (which evicts pods), or mistakenly think `--ignore-daemonsets` means no pods are evicted at all, when in fact it only excludes DaemonSet pods from eviction.

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

Node1 is marked as unschedulable and all pods except DaemonSets are evicted

The `kubectl cordon node1` command marks node1 as unschedulable, preventing new pods from being scheduled onto it. The subsequent `kubectl drain node1 --ignore-daemonsets` command evicts all pods from node1 except DaemonSets (which are ignored because they are managed by the DaemonSet controller and typically need to run on every node). This combination makes node1 unschedulable and removes all non-DaemonSet pods, preparing the node for maintenance.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Node1 is marked as unschedulable and all pods except DaemonSets are evicted

    Why this is correct

    The `kubectl cordon node1` command initially marks `node1` as unschedulable, preventing the Kubernetes scheduler from placing any new pods on it. Subsequently, `kubectl drain node1` proceeds to gracefully evict all existing pods from the node. By default, or with the `--ignore-daemonsets` flag, pods managed by DaemonSets are typically not evicted during a drain operation, as they are designed to run one instance per node. This combined action prepares the node for maintenance without disrupting critical system services.

  • Node1 is marked as unschedulable but no pods are evicted

    Why it's wrong here

    While `kubectl cordon node1` correctly marks the node as unschedulable, the subsequent `kubectl drain node1` command explicitly initiates the eviction process for all pods running on that node. The primary function of `drain` is to remove workloads to facilitate maintenance, making the assertion that no pods are evicted incorrect. Therefore, existing pods, excluding DaemonSets, would indeed be evicted from `node1`.

  • New pods are scheduled onto node1 and existing pods are evicted

    Why it's wrong here

    The first command, `kubectl cordon node1`, immediately sets the `Unschedulable` taint on the node, which prevents the Kubernetes scheduler from placing any *new* pods on `node1`. This directly contradicts the statement that new pods are scheduled. Although `kubectl drain node1` does evict existing pods, the node remains unschedulable for new deployments throughout this process, ensuring no new workloads are placed on it.

  • Node1 is marked as schedulable and all pods are evicted

    Why it's wrong here

    The `kubectl cordon node1` command's explicit purpose is to mark the node as `Unschedulable`, ensuring no new pods are scheduled there. This state is maintained during the subsequent `kubectl drain` operation, which focuses on evicting existing pods. Therefore, stating that `node1` is marked as schedulable is fundamentally incorrect, as the entire sequence of commands is designed to take the node out of active scheduling rotation for maintenance.

About these practice questions

Courseiva writes every CKA question from scratch — 302 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 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.