I am new to k8s. The kubectl command worked just fine as I was completing Kubernetes-The-Hard-Way experiment. As I cleaned up AWS resources through which I run my k8s cluster and tried using kubectl again later, an error was thrown:
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Some discussions point to moving KUBECONFIG to /etc/kubernetes/admin.conf, but this path doesn’t exist in my computer, there is no kubernetes folder under /etc. A look into my $HOME/.kube/config file produces:
apiVersion: v1 clusters: null contexts: null current-context: "" kind: Config preferences: {} users: null
Setting the environment variable to this file produces the same error.
Any ideas?
Frank Wu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.