<p>I have set up a kubernetes cluster running on AWS. What I want to do now is to control the cluster from remote machines, for example, my macbook pro.</p>

<p>I've learned that Kubernetes has RESTful apis, and Kubectl can serve as a proxy.
By running :
<code>kubectl proxy --port=8001 &amp;</code>
I can access the RESTful api with curl, for example:</p>

<pre><code>curl http://localhost:8001/api
</code></pre>

<p>Then I found that I can only curl the localhost. If I curl from a remote machine with the following command:</p>

<pre><code>curl http://dns-to-the-k8-machine:8080/api
</code></pre>

<p>I will get a "Connection refused." I wonder what is happening here? And is there a way to easily access the apis remotely?</p>

<p>Thanks in advance.</p>

<p>Depending on how you provisioned your cluster, the API server may be listening over a different port. Have a look at your <code>kubeconfig</code> file (<code>~/.kube/config</code>), in there should be a section which has the server you are connecting to.</p>

<p>Also, your cluster may be using certs or some other type of authentication which you'll need to pass as well. Those will be outlined in the same kubeconfig file. </p>

<p>When using <code>kubectl proxy</code>, kubectl is handling the pieces mentioned above automatically, and proxying back to your laptop over localhost. </p>
