etcd-operator
etcd-operator copied to clipboard
always set ETCDCTL_API=3 in pods
For the discovery.etcd.io service I wanted a one-liner to debug via etcdctl and came up with this:
kubectl exec -it $(kubectl get pods -l app=etcd -o jsonpath='{.items[0].metadata.name}') -- /usr/local/bin/etcdctl watch '' --prefix
However, it doesn't quite work because ETCDCTL_API=3 isn't set and needs to be on the entire pod. I suggest we make that the default. The hack I have implemented here works:
https://github.com/etcd-io/discovery.etcd.io/blob/master/discovery-etcd-cluster.yaml#L12
@philips that link does not work.
The file was renamed. See it here: https://github.com/etcd-io/discovery.etcd.io/blob/master/etcd-cluster.yaml#L14