OS : OSX (mac)
Docker : 18.06.0-ce (edge)
Kubernetes : 1.10.3
I use Kubernetes for the first time.
I tried Google but could not find the manual for Kubernetes, which operates on the Mac.
Running kubectl version outputs The connection to the
server localhost:8080 was refused - did you specify the right host or port?
I came across this issue when changing from minikube to the Docker Desktop supplied Kubernetes. For me, the issue was caused by a stale .kube configuration. Posting my workaround here as this was the first result I found on google when looking to troubleshoot the issue.
I had originally installed with homebrew: brew uninstall minikube. If installed using other methods, go back to your install source for uninstall info.
After minikube was uninstalled, I restarted my machine which may or may not have been necessary but it is what I did.
ls -al and look for .kube and .minikube..kube settings: rm -rf ./.kube..minikube settings: rm -rf ./.minikube.ls -al and make sure the .kube and .minikube directories have been deleted.kubectl version. You should see info for Client Version and Server Version if everything worked.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With