minikube: The connection to the server was refused

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

BUG REPORT

Minikube version (use minikube version):

minikube v0.18.0

Environment:

  • OS (e.g. from /etc/os-release):

macOS 10.12.4

  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName):

“DriverName”: “virtualbox”

  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION):

“Boot2DockerURL”: “file:///Users/conradwt/.minikube/cache/iso/minikube-0.7.iso”

  • Install tools:
  • Others:

What happened:

When I execute

$ minikube start --vm-driver=xhyve

Starting local Kubernetes cluster… Starting VM… SSH-ing files into VM… Setting up certs… Starting cluster components… Connecting to cluster… Setting up kubeconfig… Kubectl is now configured to use the cluster.

$ kubectl config use-context minikube

Switched to context “minikube”.

$ kubectl cluster-info

I get the following message

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

What you expected to happen:

I expected see the information about my Kubernetes cluster.

How to reproduce it (as minimally and precisely as possible):

$ minikube start --vm-driver=xhyve $ kubectl config use-context minikube $ kubectl cluster-info

Anything else do we need to know:

Yes, I was following steps at the following link:

https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 43 (9 by maintainers)

Most upvoted comments

And minikube version: v0.24.1

Did you try running minikube delete after installing v0.19.0 to delete your local Kubernetes cluster from your previous version of minikube? I was able to get v0.19.0 working by doing that. Then I just ran minikube start again, and it worked.

Hi Guys I am facing the similar issue, minikube version: v0.28.0 I can access minikube dashboard however, I am getting refused to connect error for all exposed services.

Any idea how we tackle this issue ? It’s taking too much time to get the k8s environment running again by minikube stop && minikube delete && minikube start

Hi Guys I am facing the similar issue, minikube version: v0.28.0 I can access minikube dashboard however, I am getting refused to connect error for all exposed services.

Same issue on Mac with minikube v0.26.1, any solution?

Confirmed! minikube delete and minikube start will resolve the issue on MacOS.

Seeing something like this on Ubuntu 18.04 and minikube 0.28.2, it renders minikube practically unusable.

Tail of log:

Aug 22 13:04:23 minikube kubelet[2816]: E0822 13:04:23.676999    2816 kubelet_node_status.go:374] Error updating node status, will retry: error getting node "minikube": Get https://localhost:8443/api/v1/nodes/minikube?timeout=10s: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

Can you share the output of minikube logs?

Same here. Clean install, Linux, --vm-driver=none

root@xxxxxx:~# kubectl cluster-info
Kubernetes master is running at https://10.xx.xx.xx:8443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
The connection to the server 10.xx.xx.xx:8443 was refused - did you specify the right host or port?
root@xxxxxx:~# minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 10.xx.xx.xx
root@xxxxxx:~# minikube version
minikube version: v0.28.1

same here, The connection to the server 192.168.99.100:8443 was refused - did you specify the right host or port? Many Users are facing similar Issue, why no traction on this.

Hello, I have tried several installation in all different machine but after reboot i get same error. i dont know what to do and it is pretty disappointing. please suggest. The connection to the server 192.168.48.141:6443 was refused - did you specify the right host or port?

Confirmed! minikube delete and minikube start will resolve the issue on MacOS.

I’ll check that.

I am having the same issue here. I have done minikube delete and minikube start several times but the same issue persists. Minikube version is 0.30 on Ubuntu 18.04.

I can also confirm to have this issue, Linux Mint 18.3 Host operating system with minikube.

Tail of log:

Jul 26 06:38:31 minikube kubelet[13564]: I0726 06:38:31.761505   13564 kuberuntime_manager.go:513] Container {Name:postgres Image:dev_postgres:local Command:[] Args:[] WorkingDir: Ports:[{Name: HostPort:0 ContainerPort:5432 Protocol:TCP HostIP:}] EnvFrom:[] Env:[] Resources:{Limits:map[] Requests:map[]} VolumeMounts:[{Name:default-token-c6knw ReadOnly:true MountPath:/var/run/secrets/kubernetes.io/serviceaccount SubPath: MountPropagation:<nil>}] VolumeDevices:[] LivenessProbe:nil ReadinessProbe:nil Lifecycle:nil TerminationMessagePath:/dev/termination-log TerminationMessagePolicy:File ImagePullPolicy:Never SecurityContext:nil Stdin:false StdinOnce:false TTY:false} is dead, but RestartPolicy says that we should restart it.
Jul 26 06:38:32 minikube kubelet[13564]: E0726 06:38:32.274566   13564 reflector.go:205] k8s.io/kubernetes/pkg/kubelet/kubelet.go:460: Failed to list *v1.Node: Get https://192.168.99.102:8443/api/v1/nodes?fieldSelector=metadata.name%3Dminikube&limit=500&resourceVersion=0: dial tcp 192.168.99.102:8443: getsockopt: connection refused
Jul 26 06:38:32 minikube kubelet[13564]: E0726 06:38:32.404531   13564 kubelet_node_status.go:374] Error updating node status, will retry: error getting node "minikube": Get https://192.168.99.102:8443/api/v1/nodes/minikube?resourceVersion=0&timeout=10s: dial tcp 192.168.99.102:8443: getsockopt: connection refused

Similar issue on Ubuntu with v0.26.1 Downgrading fixed the problem.

I ran into this as well, with minikube 0.19, but with identical logs (e.g. the journalctl thing). @sjking suggestion solved it for me; after the delete of the old machine, the newer minikube downloaded the ISO – something it didn’t too earlier on – and spun up a happy k8s.

@amitsaha I found that tpr causes the problem. If I delete them before minikube stop then I can start it again safely. Otherwise it keeps saying as title. I recall some guys also talking about the problem of minikube with tpr somewhere but just can’t refer to that discussion now.

OK I found a work around solution: delete all thirdpartyresource before stop the machine.

@conradwt I downgraded minikube to v0.17.1 and it is working again.

https://github.com/kubernetes/minikube/releases