error: unable to recognize "xxxxx-pod.yml": Get http://localhost:8080/api?timeout=32s: dial tcp 127.0.0.1:8080: connect: connection refused
,
I tried the solutions available online but none of them really worked.
It was due to the flannel issue but I think it is resolved now. I had to put a hold on the versions of kubectl as they upgraded without my knowledge. This worked for me.
This means your kubeconfig is not correct. It is using the default server URL which is probably not what you intended.