Skip to content

Instantly share code, notes, and snippets.

@Dentrax
Last active June 4, 2024 07:48
Show Gist options
  • Save Dentrax/67e2f1ccc45a04f9f5ec07b0b111ef3b to your computer and use it in GitHub Desktop.
Save Dentrax/67e2f1ccc45a04f9f5ec07b0b111ef3b to your computer and use it in GitHub Desktop.
ETCD - Interact in Kubernetes VM
  1. Export all the required environment variables:
export $(grep -v '^#' /etc/etcd.env | xargs -d '\n')
  1. Start interacting with etcdctl
etcdctl endpoint health status --cluster -w table && etcdctl endpoint status --cluster -w table
  1. Scrape Prometheus metrics on :2379 for any etcd instance:
curl -k --cacert $ETCD_TRUSTED_CA_FILE --cert $ETCD_PEER_CERT_FILE --key $ETCD_PEER_KEY_FILE $ETCD_ADVERTISE_CLIENT_URLS/metrics
  1. Object counts and sizes: https://gist.github.com/dkeightley/8f2211d6e93a0d5bc294242248ca8fbf

  2. Defragmentation: https://gist.github.com/Dentrax/bca3aaa6d71826f7495e435797c7e324

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