Unable to find Kubernetes apiserver's data in etcd3 Unable to find Kubernetes apiserver's data in etcd3 docker docker

Unable to find Kubernetes apiserver's data in etcd3


To get keys and values stored in etcd v3 by kubernetes:

ETCDCTL_API=3 etcdctl --endpoints=http://localhost:2379 get --prefix /registry

To get 1 specified key and value from etcd v3, e.g.:

ETCDCTL_API=3 etcdctl --endpoints=http://localhost:2379 get /registry/services/specs/default/kubernetes

Based on: https://github.com/coreos/etcd/blob/master/Documentation/dev-guide/interacting_v3.md


If your system is set up correctly be aware that there are some changes from etcd2 to etcd3. For example the key space in etcd3 is now flat so unlike etcd2 there are no longer any directories. Instead of using the etcdctl 'ls' command as shown above use the 'get' command instead (and make sure the etcdctl command is using the v3 api by having the ETCDCTL_API=3 environment variable set).


ETCDCTL_API=3 etcdctl --endpoints=http://localhost:2379 get / --prefix --keys-only