Hello people I am trying to understand better the etcd restore procedure, my que . . .

George Keratishvili:
Hello people I am trying to understand better the etcd restore procedure, my question is when we are specifiyind --data-dir

ETCDCTL_API=3 etcdctl  --data-dir /var/lib/etcd-from-backup \
     snapshot restore /opt/snapshot-pre-boot.db

why do we needed it?

Priyanshu:
Hello @George Keratishvili
I think first it’s an argument that is required by the etcdctl command for restoring , where to store the extracted data from backup
And second it’s for us to remember the path where data is restored or else it might restore anywhere in environment and later we might encounter with difficulty while finding it

George Keratishvili:
so --data-dir command is for uploading on etcd server side?

Mohamed Ayman:
Check the below example:

Restore ETCD Snapshot to a new folder:

ETCDCTL_API=3 etcdctl  --data-dir /var/lib/etcd-from-backup \
     snapshot restore /opt/snapshot-pre-boot.db

Note: In this case, we are restoring the snapshot to a different directory but in the same server where we took the backup (the controlplane node) As a result, the only required option for the restore command is the --data-dir.

please refer to the below link for more clarification:
https://github.com/mmumshad/kubernetes-the-hard-way/blob/master/practice-questions-answers/cluster-maintenance/backup-etcd/etcd-backup-and-restore.md#4-modify-etckubernetesmanifestsetcdyaml|https://github.com/mmumshad/kubernetes-the-hard-way/blob/master/practice-questions[…]wers/cluster-maintenance/backup-etcd/etcd-backup-and-restore.md

George Keratishvili:
@Priyanshu @Mohamed Ayman thanks