<p>I did a customized installation of Kubernetes the hardway and installed it successfully on a 2 node cluster in Hyper V (1 master 1 worker), everything works, but there's this thing that makes me scratch my head and I was wondering if anyone could give me insight about why it's happening.</p>

<pre><code>etcdctl --help
</code></pre>

<p>Gives me the etcd v2 version of the help, and it also gives me the following Warning.</p>

<blockquote>
  <p>WARNING:    Environment variable ETCDCTL_API is not set; defaults to
  etcdctl v2.    Set environment variable ETCDCTL_API=3 to use v3 API or
  ETCDCTL_API=2 to use v2 API.</p>
</blockquote>

<p>If I set the environment variable and run the command again, it's ignored:</p>

<pre><code>ETCDCTL_API=3
etcdctl --help
</code></pre>

<p>But if I do</p>

<pre><code>ETCDCTL_API=3 etcdctl --help
</code></pre>

<p>Then it gives me the etcd v3 version of the help, I also need to put ETCDCTL_API=3 in front of etcdctl snapshot save for it to be recognized as a valid command.</p>

<pre><code>ETCDCTL_API=3 etcdctl snapshot save ~/etcd.backup \
  --endpoints=https://127.0.0.1:2379 \
  --cacert=/etc/etcd/ca.pem \
  --cert=/etc/etcd/kubernetes.pem \
  --key=/etc/etcd/kubernetes-key.pem
</code></pre>

<p>Why is this?</p>

neoakris
<p>Well it turned out to be a lack of Linux knowledge. 
When I was following a few Kubernetes how to guides I used Bash variables all the time, what I didn't realize is that there's a difference between normal variables an environment variables.</p>

<p>I was doing: </p>

<pre><code>ETCDCTL_API=3 
echo $ETCDCTL_API
3
</code></pre>

<p>And it looked right, but then I remembered the printenv command, and I didn't see what I expected, that's when I figured out there was a difference between environment variables and regular variables.</p>

<p>I had to add export in front of the variable statement, to make it an environment variable.</p>

<p>What's really cool is that after reading this <br>
<a href="https://github.com/etcd-io/etcd/blob/master/etcdctl/README.md" rel="noreferrer">https://github.com/etcd-io/etcd/blob/master/etcdctl/README.md</a></p>

<p>I was able to make the above, become nice short commands like this: </p>

<pre><code>export ETCDCTL_API=3
export ETCDCTL_CACERT=/etc/etcd/ca.pem
export ETCDCTL_CERT=/etc/etcd/kubernetes.pem
export ETCDCTL_KEY=/etc/etcd/kubernetes-key.pem

etcdctl member list --endpoints=https://127.0.0.1:2379 

etcdctl snapshot save ~/etcd.backup
</code></pre>
