I have installed EKSCTL and created a cluster. It was working fine suddenly I am not able to execute kubectl commands
kubectl get svc
The connection to the server localhost:8080 was refused - did you specify the right host or port?
It is giving the above error. I check the config file it was good. Could you please help me with this
kubectl version
Client Version: version.Info{Major:"1", Minor:"16", GitVersion:"v1.16.0", GitCommit:"2bd9643cee5b3b3a5ecbd3af49d09018f0773c77", GitTreeState:"clean", BuildDate:"2019-09-18T14:36:53Z", GoVersion:"go1.12.9", Compiler:"gc", Platform:"linux/amd64"}
The connection to the server localhost:8080 was refused - did you specify the right host or port?
eksctl version
[鈩筣 version.Info{BuiltAt:"", GitCommit:"", GitTag:"0.6.0"}
did you try to update kube config by running aws eks update-kubeconfig --name <cluster name> ?
Thank you @sayboras, it worked for me.
Most helpful comment
did you try to update kube config by running
aws eks update-kubeconfig --name <cluster name>?