<p>I would like to use the etcdctl functionnalities of my etcd pod from my kurnetes cluster but I can't. I have install my kubernetes from kubeadm and I have 1 master and 1 node. </p>

<p>When I try commands etcdctl from inside of my etcd pod, I get those errors:</p>

<blockquote>
  <p>client: etcd cluster is unavailable or misconfigured;<br>
  error #0:malformed HTTP response "\x15\x03\x01\x00\x02\x02" ;<br>
  error #1: dial tcp 127.0.0.1:4001: getsockopt: connection refused</p>
</blockquote>

<p>But when I check my etcd pod log, it seems healthy :</p>

<p><a href="https://i.stack.imgur.com/UQl0D.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/UQl0D.png" alt="enter image description here"></a></p>

<p>It looks like you have <code>etcd</code> listening for client connections on <code>https://127.0.0.1:2379</code> and you have client certificate authentication enabled as far as i can see. You should then be able to run the following command to connect to <code>etcd</code>:</p>

<pre><code>ETCDCTL_API=3 etcdctl member list \
  --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/kubernetes/pki/etcd/ca.crt \
  --cert=/etc/kubernetes/pki/etcd/server.crt \
  --key=/etc/kubernetes/pki/etcd/server.key
</code></pre>

<p>Basically <code>etcd</code> expects you to authenticate using a client certificate.</p>

<p>Also, since you're running version 3.x of <code>etcd</code> you have to tell <code>etcdctl</code> that by providing the <code>ETCDCTL_API</code> environment variable.</p>

<p><strong>EDIT:</strong></p>

<p>For reference: </p>

<p>I was using <code>kubeadm</code> version 1.11.1 which installed version 3.2.18 of <code>etcd</code> on a server running Ubuntu 18.04 when testing the command above.</p>
