<p><code>error: unable to recognize "xxxxx-pod.yml": Get http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: connect: connection refused</code>, </p>

<p>I tried the solutions available online but none of them really worked.</p>

Venkateshreddy Pala
<p>This means your kubeconfig is not correct. It is using the default server URL which is probably not what you intended.</p>
