Couldn't get current server API group list
If you encounter the error message,
$ kubectl get nodes
E0526 10:52:08.347681 96830 memcache.go:265]
couldn't get current server
API group list: Get "http://localhost:8080/api?timeout=32s":
dial tcp 127.0.0.1:8080: connect: connection refused
It indicates that kubectl is unable to connect to the Kubernetes API server.
This issue can occur if you are running kubectl from a node that doesn't have the proper kubeconfig file or if the API server is not accessible.
For example, if you have configured the kubecofig file in the controlplane node, always run kubectl
commands from the controlplane node.
The kubeconfig file contains the necessary configuration information for kubectl to connect to the Kubernetes API server.
By default, kubectl looks for the kubeconfig file in the $HOME/.kube/config
directory.