Skip to content

Instantly share code, notes, and snippets.

@hemanth22
Forked from rafzei/ctr-commands.txt
Created October 12, 2022 10:28
Show Gist options
  • Save hemanth22/24fa587ff4a07799a6a5c75332e45f1e to your computer and use it in GitHub Desktop.
Save hemanth22/24fa587ff4a07799a6a5c75332e45f1e 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment