kubectl install - wrong port - config error

2/20/2019

I am installing kubectl. After installing kubectl I checked for version and got below.

I followed up documentation and checked the config. But it is empty file.

Client Version: version.Info{
    Major:"1", 
    Minor:"10", 
    GitVersion:"v1.10.3",                         
    GitCommit:"2bba0127d85d5a46ab4b778548be28623b32d0b0", 
    GitTreeState:"clean", BuildDate:"2018-05-21T09:17:39Z",                         
    GoVersion:"go1.9.3", Compiler:"gc", 
    Platform:"darwin/amd64"}

   The connection to the server localhost:8080 was refused - did you specify the right host or port?`

I dont have any local clusters. Is there anything I need to do if I want to connect to EKS Cluster on AWS?

-- Pat
kubectl
kubernetes

1 Answer

2/20/2019

The reason behind that is kubectl version prints Client Version and Server Version (kubernetes version) both. When you just install kubectl it is just kubernets client. If you have kubernetes cluster installed, it will print both kubectl version and kubernetes version.

If you want to just want to print client version, then use following command:

kubectl version --client=true

For details you can check my following answer here

-- Prafull Ladha
Source: StackOverflow