Skip to Content
Skip Breadcrumb

You will find here some all day work tips for etcd

cluster-health

This is a example from a OpenShift Cluster

/usr/bin/etcdctl --peers \
  $( awk -F= '/ETCD_LISTEN_CLIENT_URLS=/ {print $2}' < /etc/etcd/etcd.conf ) \
  --debug \
  --ca-file /etc/origin/master/master.etcd-ca.crt \
  --key-file /etc/origin/master/master.etcd-client.key \
  --cert-file /etc/origin/master/master.etcd-client.crt \
  cluster-health

cluster is healthy
member 4cc83942f30cdc13 is healthy
member 4d9d43ce9d81c2e1 is healthy
member 97f18a07f755fe77 is healthy

list entries of a cluster

You can get a inventory tree with the ls command.

/usr/bin/etcdctl --peers \
  $( awk -F= '/ETCD_LISTEN_CLIENT_URLS=/ {print $2}' < /etc/etcd/etcd.conf ) \
  --debug \
  --ca-file /etc/etcd/ca.crt \
  --key-file /etc/etcd/peer.key \
  --cert-file /etc/etcd/peer.crt \
  ls

get info for a minion

You can get information from a key like this.

/usr/bin/etcdctl --peers \
  $( awk -F= '/ETCD_LISTEN_CLIENT_URLS=/ {print $2}' < /etc/etcd/etcd.conf ) \
  --debug \
  --ca-file /etc/etcd/ca.crt \
  --key-file /etc/etcd/peer.key \
  --cert-file /etc/etcd/peer.crt \
  get /kubernetes.io/minions/<THE_HOSTNAME> | python -m json.tool

You can contact me for any further questions and orders