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

That error should only come up if you have no contexts configured in your client. If you run kubectl config view and you get something like this:

$ kubectl config view
apiVersion: v1
clusters: []
contexts: []
current-context: ""
kind: Config
preferences: {}
users: []

Then no contexts are configured.

4 Likes