0
0
Kubernetesdevops~20 mins

etcd backup and recovery in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Etcd Backup & Recovery Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Identify the output of an etcd snapshot save command
What is the expected output when you run the following command to save an etcd snapshot?

etcdctl snapshot save /tmp/etcd-backup.db
Kubernetes
etcdctl snapshot save /tmp/etcd-backup.db
ASnapshot failed: permission denied
BError: snapshot save requires --endpoints flag
Cetcdctl: command not found
DSnapshot saved at /tmp/etcd-backup.db
Attempts:
2 left
💡 Hint
The command saves the snapshot file to the specified path if permissions and environment are correct.
🧠 Conceptual
intermediate
1:30remaining
Understanding etcd snapshot restore behavior
When restoring an etcd cluster from a snapshot, which of the following is true about the restored data directory?
AThe restored data directory must be empty or non-existent before restore
BThe restore command appends data to the existing data directory
CRestore overwrites only the WAL files but keeps existing snapshots
DRestore merges snapshot data with current cluster data automatically
Attempts:
2 left
💡 Hint
Think about how restoring a snapshot replaces the cluster state.
Troubleshoot
advanced
2:00remaining
Troubleshoot etcd snapshot restore failure due to permission error
You run the command:

etcdctl snapshot restore /backup/etcd-snapshot.db --data-dir /var/lib/etcd-new

and get the error:

restore failed: open /var/lib/etcd-new/member/snap/db: permission denied

What is the most likely cause?
AThe etcdctl version is incompatible with the snapshot version
BThe snapshot file /backup/etcd-snapshot.db is corrupted
CThe user running the command lacks write permissions on /var/lib/etcd-new
DThe data directory /var/lib/etcd-new already contains running etcd data
Attempts:
2 left
💡 Hint
Permission denied errors usually relate to filesystem access rights.
🔀 Workflow
advanced
2:30remaining
Correct sequence to backup and restore etcd cluster
Arrange the steps in the correct order to safely backup and restore an etcd cluster:
A2,1,3,4
B1,2,3,4
C1,3,2,4
D2,3,1,4
Attempts:
2 left
💡 Hint
Backup first, then stop service before restore, then start service with restored data.
Best Practice
expert
3:00remaining
Best practice for automating etcd backups in production
Which approach is considered best practice for automating etcd backups in a production Kubernetes cluster?
ASchedule regular 'etcdctl snapshot save' commands with proper endpoint and authentication, storing backups securely off-node
BBackup etcd data directory files directly while etcd is running for speed
CUse etcdctl snapshot save without authentication flags to simplify automation
DManually run snapshot commands only when cluster issues occur to avoid performance impact
Attempts:
2 left
💡 Hint
Consider security, reliability, and minimal disruption in production environments.