Search code examples
kubernetesetcd

Choose the correct version of etcd backup in Kubernetes


I want to create a snapshot of the etcd instance. The etcd instance is running etcd version 3.3.10. I used ETCDCTL_API=3 in the following command:

ETCDCTL_API=3 etcdctl 
--endpoints https://[127.0.0.1]:2379 
--cacert /opt/ca.crt 
--cert /opt/etcd-client.crt 
--key=/opt/etcd-client.key 
  snapshot save > /var/lib/backup/etcd-snapshot.db

Which version of ETCDCTL_API should I use? Should I use the highest version? 


Solution

  • "etcdctl snapshot save /path/file_name.db" command works only when the api version is set to 3

    export ETCDCTL_API=3
    

    there no option available in api version 2 to run the command with the snapshot save option.