Minikube on Windows with VirtualBox: Connection attempt fail

3/16/2017

I got Kubernetes Minikube on my laptop (4cores, 8 GB RAM). I just performed the basic installation steps (got miniKube and kubectl, enabled the BIOS virtualization) and I am able to start the cluster:

C:\Users\me>minikube start
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.

However, when I try to interact with the cluster, I allways get the same error, sample:

C:\Users\me>kubectl get pods --context=minikube
Unable to connect to the server: dial tcp 192.168.99.100:8443: connectex: A connection attempt failed because the connected party
did not properly respond after a period of time, or established connection failed because connected host has failed to respond.

I execute minikube ip and I ping the result IP and I get a response. Also I tried to give more memory (3Gb vs the standard 2Gb) and nothing changed.

Am I doing something wrong here?

Thanks!

-- Victor
kubectl
kubernetes
minikube

3 Answers

12/15/2017

If it keep to hit 8443 connection issue when changed work environment, would simplify turn off TLS verification for minikube local cluster if there is not clue.

https://github.com/robertluwang/docker-hands-on-guide/blob/master/minikube-no-tls-verify.md

Hope it is helpful for you.

BR/ Robert

-- robertluwang
Source: StackOverflow

9/22/2017

I think it could be some problem with the cluster, when I run minikube status I've got the mixed results of cluster running and cluster stopped:

First run:

c:\> minikube status

minikube: Running

cluster: Stopped

kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

Second run:

minikube: Running cluster: Running kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

Third run:

minikube: Running

cluster: Stopped

kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

The service is flapping.

UPDATED: Connecting to the minikube vm using minikube ssh I realized the kubeconfig file have wrong path separator for certificates generated by minikube automatic configuration. The path on kubeconfig file stands for \var\lib\localkube\certs\ca.cert and it have to be /var/lib/localkube/certs/ca.cert and so on...

To update the file I have to copy the content of the orignal file to my desktop, fix the directory separators and save the correct file to /var/lib/localkube/kubeconfig and restart the service using:

sudo systemclt restart localkube.

I hope everyone can use minikube with this tip.

-- Amioranza
Source: StackOverflow

8/14/2017

I had same issue as above. I found out that kubectl couldn't connect to the cluster and would throw up the error when i'm on a VPN connection. When I turned off my VPN client, it started working as fine.

-- Innocent Anigbo
Source: StackOverflow