title: The connection to the server localhost:8080 was refused
body: <p>I was able to cluster 2 nodes together in Kubernetes. The master node seems to be running fine but running any command on the worker node results in the error: "The connection to the server localhost:8080 was refused - did you specify the right host or port?"</p>
  
  <p>From master (node1), </p>
  
  <pre><code>$ kubectl get nodes
  NAME       STATUS    AGE       VERSION
  node1       Ready     23h       v1.7.3
  node2       Ready     23h       v1.7.3
  </code></pre>
  
  <p>From worker (node 2),</p>
  
  <pre><code>$ kubectl get nodes
  The connection to the server localhost:8080 was refused - did you specify the right host or port?
  
  $ telnet localhost 8080
  Trying ::1...
  telnet: connect to address ::1: Connection refused
  Trying 127.0.0.1...
  telnet: connect to address 127.0.0.1: Connection refused
  
  $ ping localhost
  PING localhost (127.0.0.1) 56(84) bytes of data.
  64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.032 ms
  </code></pre>
  
  <p>I am not sure how to fix this issue. Any help is appreciated. </p>
  
  <p>On executing,"journalctl -xeu kubelet" I see: 
  "CNI failed to retrieve network namespace path: Cannot find network namespace for the terminated container", but this seems to be related to installing a pod network ... which I am not able to because of the above error.</p>
  
  <p>Thanks!</p>