Skip to content

Instantly share code, notes, and snippets.

@patrick0057
Last active June 4, 2020 20:09
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrick0057/e58b5b695763308ffcadb5c0c1e50b44 to your computer and use it in GitHub Desktop.
Save patrick0057/e58b5b695763308ffcadb5c0c1e50b44 to your computer and use it in GitHub Desktop.
working with etcd keys, notes

working with etcd keys, notes

restore snapshot to work with

docker run --rm -v $(pwd):/data -e ETCDCTL_API=3 -w /data quay.io/coreos/etcd etcdctl snapshot restore snapshot.db

run snapshot to work with

docker run --name etcd -d -v $(pwd):/data -e ETCDCTL_API=3 -w /data quay.io/coreos/etcd

dump keys to debug

docker exec -it etcd etcdctl get --command-timeout=5m --keys-only --prefix /registry > keys

example delete commands

docker exec -it $CONTAINER etcdctl del /registry/project.cattle.io/apps/p-nsdcv/cluster-monitoring
docker exec -it $CONTAINER etcdctl del /registry/project.cattle.io/apps/p-nsdcv/monitoring-operator
docker exec -it $CONTAINER etcdctl del /registry/project.cattle.io/apps/p-nsdcv/project-monitoring
docker exec -it $CONTAINER etcdctl del --prefix /registry/project.cattle.io/apprevisions/p-nsdcv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment