Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

kubectl install error -The connection to the server localhost:8080 was refused - did you specify the right host or port

i am trying to install a kops cluster on AWS and to that as a pre-requisite i installed kubectl as per these instructions provided,

https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl

but when i try to verify the installation, i am getting the below error.

ubuntu@ip-172-31-30-74:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"8", GitVersion:"v1.8.0", GitCommit:"6e937839ac04a38cac63e6a7a306c5d035fe7b0a", GitTreeState:"clean", BuildDate:"2017-09-28T22:57:57Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?

i am not sure why! because i had set up cluster with similar way earlier and everything worked fine. Now wanted to set up a new cluster, but kind of stuck in this.

Any help appreciated.

like image 398
Shruthi Bhaskar Avatar asked Jul 10 '18 12:07

Shruthi Bhaskar


1 Answers

Two things :

  1. If every instruction was followed properly, and still facing same issue. @VAS answer might help.
  2. However in my case, i was trying to verify with kubectl as soon as i deployed a cluster. It is to be noted that based on the size of the master and worker nodes cluster takes some time to come up.

Once the cluster is up, kubectl was successfully able to communicate. As silly as it sounds, i waited out for 15 mins or so until my master was successfully running. Then everything worked fine.

like image 187
Shruthi Bhaskar Avatar answered Sep 16 '22 21:09

Shruthi Bhaskar