The connection to the server localhost:8080 was refused AWS EKS

Connection to AWS EKS Cluster is failing from kubectl

 $ kubectl get pods
 The connection to the server localhost:8080 was refused - did you specify the right host or port? 

Solution: Recreate the Kube config file and export

$ aws eks --region region update-kubeconfig --name cluster_name
$ export KUBECONFIG=~/.kube/config