Skip to content

Instantly share code, notes, and snippets.

@Dentrax
Last active June 2, 2023 12:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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