title: Kubernetes failed to discover supported resources: getsockopt: connection refused
body: <p>I am going through the kubernetes tutorial at Udacity. When i run the the nginx image using the following command </p>
  
  <pre><code>kubectl run nginx --image=nginx:1.10.0
  </code></pre>
  
  <p>It given me the error </p>
  
  <blockquote>
    <p>error: failed to discover supported resources: Get <a href="http://localhost:8080/apis/extensions/v1beta1" rel="noreferrer">http://localhost:8080/apis/extensions/v1beta1</a>: dial tcp 127.0.0.1:8080: getsockopt: connection refused</p>
  </blockquote>
  
  <p>If i try to get pods using the following command</p>
  
  <pre><code>kubectl get pods
  </code></pre>
  
  <p>it says</p>
  
  <blockquote>
    <p>The connection to the server localhost:8080 was refused - did you specify the right host or port?</p>
  </blockquote>
  
  <p>The nginx server is running, i can tell because i can get the appropriate output by running curl <a href="http://127.0.0.1" rel="noreferrer">http://127.0.0.1</a></p>
  
  <p>I am not able to figure out what the issue is, and there are not a lot of resources on the internet for this problem. Can anyone please tell me how do i resolve it?</p>