Skip to content

Instantly share code, notes, and snippets.

@rafzei
Created January 24, 2022 10:58
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save rafzei/31fb9af0c90ede46a8676e90c9d258b3 to your computer and use it in GitHub Desktop.
Save rafzei/31fb9af0c90ede46a8676e90c9d258b3 to your computer and use it in GitHub Desktop.
ctr commands
# List images in k8s
ctr --namespace k8s.io image list
# Create etcd snapshot
ctr --namespace k8s.io \
run \
--mount type=bind,src={{ backup_temp_dir.path }}/,dst=/backup/,options=rbind:rw \
--net-host \
--env ETCDCTL_API=3 \
--rm "{{ etcd_image_name.stdout | trim }}" \
etcd \
etcdctl \
--endpoints https://127.0.0.1:2379 \
--cacert /backup/pki/etcd/ca.crt \
--cert /backup/pki/etcd/healthcheck-client.crt \
--key /backup/pki/etcd/healthcheck-client.key \
snapshot save /backup/etcd-snapshot.db
@rafzei
Copy link
Author

rafzei commented Jan 24, 2022

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment