<p>All my <code>kubectl get</code> commands are failing with the following error <code>The connection to the server localhost:8080 was refused - did you specify the right host or port?</code></p>

<p>I checked the ip of my <code>/etc/kubernetes/admin.conf</code> and it has the following apart from other stuff: <code>server: https://10.23.23.19:6443</code></p>

<p>Since that is the IP of my machine, I thought of running the command like this <code>kubectl get pods --server=10.23.23.19:6443</code></p>

<p>Above gives me the error - <code>Unable to connect to the server: net/http: HTTP/1.x transport connection broken: malformed HTTP response "\x15\x03\x01\x00\x02\x02"</code></p>

<p>What am I doing wrong? I have a 3 node cluster and all this is on the master. When 2 other nodes joined, they did join successfully is what I saw as the status on the screen though.</p>

<p>I used this tutorial(with slight deviations of my own to get started) - <a href="https://www.linuxtechi.com/install-kubernetes-1-7-centos7-rhel7/" rel="nofollow noreferrer">https://www.linuxtechi.com/install-kubernetes-1-7-centos7-rhel7/</a></p>

<p><code>/etc/kubernetes/admin.conf</code> is the location that the provisioning system placed your config in, but it is not the one used by kubectl by default. The usual place that kubectl looks at for configuration is <code>~/.kube/config</code> so either put your config file there or hint to kubectl that it needs to look in a different place with <code>--kubeconfig &lt;path&gt;</code> param.</p>
