<h1>Question</h1>

<p>How to get the Kubernetes related keys from etcd? Tried to list keys in etcd but could not see related keys. Also where is etcdctl installed?</p>

<pre><code>$ etcdctl
bash: etcdctl: command not found..

$ sudo netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 127.0.0.1:2379          0.0.0.0:*               LISTEN      386/etcd            
tcp        0      0 127.0.0.1:2380          0.0.0.0:*               LISTEN      386/etcd            

$ curl -s http://localhost:2379/v2/keys | python -m json.tool
{
    "action": "get",
    "node": {
        "dir": true
    }
}
</code></pre>

<h1>Background</h1>

<p>Installed Kubernetes 1.8.5 by following <a href="https://kubernetes.io/docs/setup/independent/create-cluster-kubeadm/" rel="noreferrer">Using kubeadm to Create a Cluster</a> on CentOS 7. When I looked at <a href="https://coreos.com/etcd/docs/latest/getting-started-with-etcd.html" rel="noreferrer">Getting started with etcd</a>, v2/keys looks to be the end point.</p>

<p>Usually you need to get <code>etcdctl</code> by yourself. Just download the latest <code>etcdctl</code> archive from <a href="https://github.com/coreos/etcd/releases" rel="noreferrer">etcd releases page</a>.</p>

<p>Also, starting from Kubernetes version 1.6 it uses etcd version 3, so to get a list of all keys is:</p>

<pre><code>ETCDCTL_API=3 etcdctl --endpoints=&lt;etcd_ip&gt;:2379 get / --prefix --keys-only
</code></pre>

<p>You can find all <code>etcdctl v3</code> actions using:</p>

<pre><code>ETCDCTL_API=3 etcdctl --endpoints=&lt;etcd_ip&gt;:2379 --help
</code></pre>

<p><strong>EDIT</strong> (thanks to @leodotcloud):</p>

<p>In case ETCD is configured with TLS certificates support:</p>

<pre><code>ETCDCTL_API=3 etcdctl --endpoints &lt;etcd_ip&gt;:2379 --cacert &lt;ca_cert_path&gt; --cert &lt;cert_path&gt; --key &lt;cert_key_path&gt; get / --prefix --keys-only
</code></pre>
