title: Configuring kubectl against remote clusters
body: <p>I followed the <a href="http://kubernetes.io/v1.0/docs/getting-started-guides/docker.html" rel="noreferrer">Kubernetes docs for setting up a single node cluster as a Docker container</a>. I now have Kubernetes running on a remote Linux VM (say, <code>mykube01.example.com</code>).</p>
  
  <p>I then downloaded and installed <code>kubectl</code> locally on my Mac laptop. I can run <code>kubectl version</code> and it verifies I have installed the correct version.</p>
  
  <p>I then went to configure <code>kubectl</code> by <a href="http://kubernetes.io/v1.0/docs/user-guide/kubeconfig-file.html" rel="noreferrer">following this doc</a> and created the following <code>~/.kube/config</code> file:</p>
  
  <pre><code> apiVersion: v1
   clusters:
   - cluster:
        api-version: v1
        server: http://mykube01.example.com:8080
        name: testkube
  </code></pre>
  
  <p>When I run <code>kubectl cluster-info</code> I get:</p>
  
  <pre><code>Kubernetes master is running at http://mykuber01.example.com:8080
  </code></pre>
  
  <p>But when I run <code>kubetctl get nodes</code> I get:</p>
  
  <pre><code>The connection to the server mykube01.example.com:8080 was refused - did you specify the right host or port?
  </code></pre>
  
  <p>Any ideas where I'm going awry? I want to get to the point where I can keep going with that first Kubernetes doc and deploy nginx to the 1-node cluster via:</p>
  
  <pre><code>kubectl -s http://mykube01.example.com:8080 run-container nginx --image=nginx --port=80
  </code></pre>
  
  <p>But I can't do that until I get <code>kubectl</code> configured properly and correctly connecting to my remote "cluster".</p>