CKA Free Quiz

No account or credit card needed — your score shows right here.
Question 1 of 10
0 answered
Question #1

On a kubeadm cluster, etcd runs as a static Pod whose `etcd-data` hostPath volume points to /var/lib/etcd. You stopped all API server instances. Then you ran `etcdutl --data-dir /var/lib/etcd-restore snapshot restore snapshot.db`, and it succeeded. etcd still serves the old data. What must you do next so etcd uses the restored data?

Correct Answer

In plain English

Restoring a snapshot is like unpacking a backup into a new folder. The program keeps opening its old folder until you change its settings and restart it.

The principle

A restore to a new data directory only takes effect after etcd's configuration points to it and etcd restarts.

Why this is correct
  • The restore wrote data to a new folder, /var/lib/etcd-restore.
  • The etcd static Pod still mounts /var/lib/etcd through the etcd-data hostPath volume.
  • The docs say to change that volumes.hostPath.path in /etc/kubernetes/manifests/etcd.yaml.
  • Then delete the etcd Pod or restart kubelet (or both) so etcd starts on the new directory.
Why the other options fail
  • B
    • --etcd-servers takes etcd client URLs, not a data directory path.
    • It only needs changing if the restored cluster's access URLs changed.
  • C
    • etcdctl snapshot save creates a backup from a live member.
    • It does not load restored data into etcd.
  • D
    • Restoring into the same folder requires deleting it and stopping etcd first.
    • Restoring while etcd keeps running breaks that rule.
Exam trap
  • Assuming a successful snapshot restore is live immediately; it only writes a data directory that etcd must be configured to use.
  • With etcdutl, <data-dir-location> is a directory created during the restore process.
  • Using etcdctl for restore is deprecated since etcd v3.5.x and slated for removal in v3.6.
  • Before restoring, stop all API server instances, restore all etcd instances, then restart the API servers.
  • The project also recommends restarting kube-scheduler, kube-controller-manager and kubelet to avoid stale data.
  • If the restored cluster's access URLs change, restart API servers with --etcd-servers=$NEW_ETCD_CLUSTER.
Check it in the official docs · kubernetes.io ↗
Answered

0/10

Correct

0

Score

0%

You got of 10 correct.

Get your full breakdown by email

Per-question review, weak spots to study, and explanations.

Create a free account to explore your study tools

The full CKA question bank with complete explanations is part of the Exam Pass.

Question Navigator
Current
Correct
Wrong