etcdctl: unknown command "save" for "etcdctl"

1/29/2022

I entered the etcd container:

kubectl -n kube-system exec -it etcd-k8scp -- sh

The I try to backup the container like explained in the K8s docs

ETCDCTL_API=3 etcdctl --endpoints $ENDPOINT snapshot save snapshotdb

I get this error:

Error: unknown command "save" for "etcdctl"

What's wrong with my command?

-- guettli
etcd
etcdctl
kubernetes

1 Answer

1/29/2022

I forgot to set $ENDPOINT.

If it is empty, then etcdctl gets this:

ETCDCTL_API=3 etcdctl --endpoints snapshot save snapshotdb

etcdctl thinks I want to address the endpoint called "snapshot" and execute the command "save"

:-)

-- guettli
Source: StackOverflow