0
0
Kubernetesdevops~10 mins

etcd backup and recovery in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to create a snapshot backup of etcd.

Kubernetes
ETCDCTL_API=3 etcdctl snapshot save [1]
Drag options to blanks, or click blank then click option'
A/etc/etcd/etcd.conf
B/var/lib/etcd/backup.db
C/usr/local/bin/etcd
D/var/log/etcd.log
Attempts:
3 left
💡 Hint
Common Mistakes
Using a directory path instead of a file path.
Using a config or log file path instead of a backup file.
2fill in blank
medium

Complete the command to check the status of the etcd cluster.

Kubernetes
ETCDCTL_API=3 etcdctl endpoint [1]
Drag options to blanks, or click blank then click option'
Amember
Bbackup
Crestore
Dstatus
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'backup' or 'restore' which are unrelated to status checking.
Using 'member' which lists cluster members but not status.
3fill in blank
hard

Fix the error in the restore command by completing the missing flag.

Kubernetes
ETCDCTL_API=3 etcdctl snapshot restore backup.db [1] /var/lib/etcd-new
Drag options to blanks, or click blank then click option'
A--data-dir
B--backup-dir
C--config-file
D--log-dir
Attempts:
3 left
💡 Hint
Common Mistakes
Using --backup-dir which is not a valid flag for restore.
Confusing data directory with config or log directories.
4fill in blank
hard

Fill both blanks to set environment variables for etcdctl to connect securely.

Kubernetes
export ETCDCTL_API=3
export ETCDCTL_ENDPOINTS=[1]
export ETCDCTL_CACERT=[2]
Drag options to blanks, or click blank then click option'
Ahttps://127.0.0.1:2379
B/etc/ssl/etcd/ca.crt
C/var/lib/etcd/data
Dhttp://localhost:2380
Attempts:
3 left
💡 Hint
Common Mistakes
Using HTTP instead of HTTPS for secure connection.
Using data directory path instead of CA certificate path.
5fill in blank
hard

Fill all three blanks to create a snapshot, check its status, and restore it to a new directory.

Kubernetes
ETCDCTL_API=3 etcdctl snapshot save [1]
ETCDCTL_API=3 etcdctl endpoint status --write-out=table
ETCDCTL_API=3 etcdctl snapshot restore [2] [3]
Drag options to blanks, or click blank then click option'
A/var/backups/etcd-snapshot.db
C--data-dir /var/lib/etcd-restored
D--data-dir /var/lib/etcd-new
Attempts:
3 left
💡 Hint
Common Mistakes
Using different snapshot file names for save and restore.
Omitting the --data-dir flag or using wrong directory.