Exploring the OpenShift etcd with etcdctl
Kubernetes uses etcd as the persistent store for API data. As etcd is a distributed key-value store, we can also use command line tools to query this store. The examples in this post are for OpenShift 3.x.
Apart from just using get
, there is also the possibility to perform the following actions on certain keys:
put
to write to a key – unless you know what you are doing, don’t touch the Kubernetes data in etcd, as this will manifest in very strange Kubernetes behaviour.del
to delete a key – also, this may break your Kubernetes cluster by introducing inconsistencies.watch
to keep a watch on an object. This is very helpful to track changes on a certain object.
The get
action is probably the most helpful functionality for in-depth API debugging directly within etcd.