docker exec -ti $(docker ps | grep -E "rancher/rancher:|rancher/rancher " | awk '{ print $1 }') bash -c "ETCDCTL_API=3 ETCDCTL_ENDPOINTS='https://127.0.0.1:2379' ETCDCTL_CACERT='/var/lib/rancher/k3s/server/tls/etcd/server-ca.crt' ETCDCTL_CERT='/var/lib/rancher/k3s/server/tls/etcd/server-client.crt' ETCDCTL_KEY='/var/lib/rancher/k3s/server/tls/etcd/server-client.key' etcdctl get / --prefix --keys-only"
docker exec $(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') etcdctl get / --prefix --keys-only
docker run -e ETCDCTL_API=3 --net=container:$(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') quay.io/coreos/etcd:v$(docker exec $(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') curl -s http://localhost:2379/version | docker run -i oildex/jq:1.6 jq -r .etcdserver) etcdctl get / --prefix --keys-only
etcd 3.3.x (Rancher 2.3.x)
docker exec $(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') curl -s -X POST -d '{"key": "AA==", "range_end": "AA=="}' http://localhost:2379/v3alpha/kv/range | docker run -i oildex/jq:1.6 jq -r '.kvs[].key | @base64d'
etcd 3.4.x (Rancher 2.4.x/Rancher v2.5.x)
docker exec $(docker ps | grep -E "rancher/rancher:|rancher/rancher |rancher/rancher@|rancher_rancher" | awk '{ print $1 }') curl -s -X POST -d '{"key": "AA==", "range_end": "AA=="}' http://localhost:2379/v3/kv/range | docker run -i oildex/jq:1.6 jq -r '.kvs[].key | @base64d'