1
votes

when i run this command mentioned below kubectl get po -n kube-system I get this error :: The connection to the server localhost:8080 was refused - did you specify the right host or port?

2
kubectl cluster-info is up ? - Thanh Nguyen Van
no it's not. when i run kubectl cluster-info, it throws same error. - Adarsha Jha
which's OS did you install kubectl ? - Thanh Nguyen Van
@ThanhNguyenVan I'm using ubuntu 16.04 version. - Adarsha Jha
did you start kubeadm init ? - Thanh Nguyen Van

2 Answers

4
votes

localhost:8080 is the default server to connect to if there is no kubeconfig present on your system (for the current user).

Follow the instructions on the page linked. You will need to execute something like:

gcloud container clusters get-credentials [CLUSTER_NAME]

0
votes

Hey I resolved my error of:

Try using this GitHub thread and read the entire comment and do exactly as it says:

https://github.com/Hawaiideveloper/Infastructure-as-Code-Sample_Env/issues/15#issuecomment-811377749

It turned out to be a combination of commands and references to incompatible docker versions, as well as some minor things that Kubernetes documentation 03-31-2021 forgot to mention.