minikube: Unable to connect to the server: dial tcp : i/o timeout

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

Minikube version (use minikube version): Tried with both v0.17.1 and v0.16.0

Environment:

  • OS (e.g. from /etc/os-release): Mac OS Sierra 10.12.3
  • 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/srinkri2/.minikube/cache/iso/minikube-v1.0.6.iso
  • Install tools: None
  • Others:

What happened:

$ VBoxManage --version 5.1.14r112924 $ minikube status minikubeVM: Running localkube: Running

$ kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.4 --port=8080 Unable to connect to the server: dial tcp 192.168.99.102:8443: i/o timeout

What you expected to happen: Deployment should have proceeded and created.

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

Anything else do we need to know:

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 32 (2 by maintainers)

Most upvoted comments

Was having this problem on fresh installs of both Ubuntu Zesty and Fedora 26 with Virtualbox. My solution was to run ifconfig vboxnet0 up

Although ip addr show was showing the correct ip being set the minikube was not bringing up the interface.

FWIW, I have a similar problem on macOS, and found that the VPN will make the API server 192.168.99.100 unreachable.

Was having this problem on fresh installs of both Ubuntu Zesty and Fedora 26 with Virtualbox. My solution was to run ifconfig vboxnet0 up

I also had to restart minikube via minikube stop && minikube start for kubectl to connect.

@mehuman Worked for me as well with Ubuntu

Before sudo ifconfig vboxnet0 up

15: vboxnet0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop state DOWN group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.1/24 scope global vboxnet0
       valid_lft forever preferred_lft forever

and after

15: vboxnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 0a:00:27:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.99.1/24 scope global vboxnet0
       valid_lft forever preferred_lft forever
    inet6 fe80::800:27ff:fe00:0/64 scope link 
       valid_lft forever preferred_lft forever

Check if you have VPN connection. In my case, after disconnect VPN, everything is working.

BTW, reconnect and authorize works for me. gcloud container clusters get-credentials my-cluster-name

Just a note here in case anyone else finds this useful, “little snitch” has a code signature validation feature that can block kubectl from executing- so beware you may have to disable the network filter before getting started-- if you are using this app.

I saw the same error too when I ran docker build -t hello-node:v1 . in the tutorial https://kubernetes.io/docs/tutorials/stateless-application/hello-minikube/#create-a-docker-container-image on Mac OS X Sierra (10.12.6), Docker version 17.12.0-ce, minikube version v0.25.0, xhyve version 0.2.0 and kubernetes version v1.9.0:

$ docker build -t hello-node:v1 .
Sending build context to Docker daemon  3.072kB
Step 1/4 : FROM node:6.9.2
Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.64.1:53: read udp 192.168.64.3:37095->192.168.64.1:53: read: connection refused

Switching to virtualbox fixed this issue for me.

I stopped minikube, deleted it, started it without --vm-driver=xhyve (minikube uses virtualbox driver by default), and then docker build -t hello-node:v1 . worked fine without errors:

minikube stop
eval $(minikube docker-env -u)
minikube delete

minikube start (without --vm-driver=xhyve)

eval $(minikube docker-env)
docker build -t hello-node:v1 .

$ docker images | grep hello
hello-node                                    v1                  9cc51aa82a30        39 seconds ago      655MB

I do see the kube-dns pod running:

$ kubectl get pod --all-namespaces
NAMESPACE     NAME                                    READY     STATUS    RESTARTS   AGE
kube-system   kube-addon-manager-minikube             1/1       Running   0          1m
kube-system   kube-dns-54cccfbdf8-vmvjm               3/3       Running   0          1m
kube-system   kubernetes-dashboard-77d8b98585-5mbcf   1/1       Running   0          1m
kube-system   storage-provisioner                     1/1       Running   0          1m

This issue does look like an xhyve issue not seen with virtualbox. My virtualbox version is 5.2.6r120293:

$ VBoxManage --version
5.2.6r120293

@mehuman, @weisserd I could kiss you right now I was going a little nutty about this. This finally worked for me. Thx!

I have the same problem:

Docker for mac works correctly, but Minikube docker host doesn’t seem to be able to pull images.

OS: macos Sierra 10.12.2 (16C67) Driver: xhyve ISO: minikube-v1.0.7.iso

10:35:11 ~$ minikube version
minikube version: v0.17.1
10:35:18 ~$ 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.
10:36:00 ~$ minikube status
minikubeVM: Running
localkube: Running
10:38:06 ~$ kubectl cluster-info
Kubernetes master is running at https://192.168.64.6:8443

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
10:38:22 ~$ echo $(minikube docker-env)
export DOCKER_TLS_VERIFY="1" export DOCKER_HOST="tcp://192.168.64.6:2376" export DOCKER_CERT_PATH="/Users/pedro/.minikube/certs" export DOCKER_API_VERSION="1.23" # Run this command to configure your shell: # eval $(minikube docker-env)
10:38:42 ~$ eval $(minikube docker-env)
10:38:49 ~$ doc
docker                         docker-credential-osxkeychain  docker-machine-driver-xhyve
docker-compose                 docker-machine
10:38:49 ~$ docker info
Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.11.1
Storage Driver: overlay
 Backing Filesystem: extfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge null host
Swarm:
 NodeID:
 Is Manager: false
 Node Address:
Init Binary:
containerd version:
runc version:
init version:
Kernel Version: 4.7.2
Operating System: Buildroot 2016.08
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.954 GiB
Name: minikube
ID: KQ56:O562:XOCU:ZFCF:RZNZ:Z4RA:FGBF:GTEK:GGJQ:SKWQ:NY3Z:TFU3
Docker Root Dir: /mnt/sda1/var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Labels:
 provider=xhyve
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false
10:38:56 ~$ docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
14476b82a347        bridge              bridge              local
30d8f0cee9d1        host                host                local
3935c51c0ad6        none                null                local
10:39:06 ~$ docker pull node:6.9.2
Pulling repository docker.io/library/node
Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/node/images. You may want to check your internet connection or if you are behind a proxy.
10:39:37 ~$ minikube ssh systemctl status localkube
● localkube.service - Localkube
   Loaded: loaded (/lib/systemd/system/localkube.service; enabled; vendor preset: enabled)
   Active: active (running) since Sun 2017-03-05 09:36:00 UTC; 3min 46s ago
     Docs: https://github.com/kubernetes/minikube/tree/master/pkg/localkube
 Main PID: 3097 (localkube)
    Tasks: 16 (limit: 4915)
   Memory: 139.0M
      CPU: 22.263s
   CGroup: /system.slice/localkube.service
           ├─3097 /usr/local/bin/localkube --generate-certs=false --logtostderr=true --enable-dns=false --node-ip=192.168.64.6 --apiserver-name=minikubeCA
           └─3182 journalctl -k -f

Mar 05 09:38:05 minikube localkube[3097]: E0305 09:38:05.487344    3097 docker_manager.go:2183] Failed to create pod infra container: ErrImagePull; Skipping pod "kube-addon-manager-minikube_kube-system(9b29121baa99a09de533b255cb6c9ea7)": image pull failed for gcr.io/google_containers/pause-amd64:3.0, this may be because there are no credentials on this request.  details: (Error response from daemon: Get https://gcr.io/v1/_ping: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.6:51243->192.168.64.1:53: i/o timeout)
Mar 05 09:38:05 minikube localkube[3097]: E0305 09:38:05.487665    3097 pod_workers.go:184] Error syncing pod 9b29121baa99a09de533b255cb6c9ea7, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for gcr.io/google_containers/pause-amd64:3.0, this may be because there are no credentials on this request.  details: (Error response from daemon: Get https://gcr.io/v1/_ping: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.6:51243->192.168.64.1:53: i/o timeout)"
Mar 05 09:38:06 minikube localkube[3097]: E0305 09:38:06.765909    3097 docker_manager.go:2183] Failed to create pod infra container: ImagePullBackOff; Skipping pod "kube-addon-manager-minikube_kube-system(9b29121baa99a09de533b255cb6c9ea7)": Back-off pulling image "gcr.io/google_containers/pause-amd64:3.0"
Mar 05 09:38:06 minikube localkube[3097]: E0305 09:38:06.766023    3097 pod_workers.go:184] Error syncing pod 9b29121baa99a09de533b255cb6c9ea7, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause-amd64:3.0\""
Mar 05 09:39:05 minikube localkube[3097]: E0305 09:39:05.515044    3097 docker_manager.go:2183] Failed to create pod infra container: ErrImagePull; Skipping pod "hello-minikube-3015430129-nxlgt_default(bfd41171-017c-11e7-9801-a63c1b79fdfb)": image pull failed for gcr.io/google_containers/pause-amd64:3.0, this may be because there are no credentials on this request.  details: (Error response from daemon: Get https://gcr.io/v1/_ping: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.6:56314->192.168.64.1:53: i/o timeout)
Mar 05 09:39:05 minikube localkube[3097]: E0305 09:39:05.515636    3097 pod_workers.go:184] Error syncing pod bfd41171-017c-11e7-9801-a63c1b79fdfb, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for gcr.io/google_containers/pause-amd64:3.0, this may be because there are no credentials on this request.  details: (Error response from daemon: Get https://gcr.io/v1/_ping: dial tcp: lookup gcr.io on 192.168.64.1:53: read udp 192.168.64.6:56314->192.168.64.1:53: i/o timeout)"
Mar 05 09:39:20 minikube localkube[3097]: I0305 09:39:20.172370    3097 operation_executor.go:917] MountVolume.SetUp succeeded for volume "kubernetes.io/secret/bfd41171-017c-11e7-9801-a63c1b79fdfb-default-token-gg21h" (spec.Name: "default-token-gg21h") pod "bfd41171-017c-11e7-9801-a63c1b79fdfb" (UID: "bfd41171-017c-11e7-9801-a63c1b79fdfb").
Mar 05 09:39:20 minikube localkube[3097]: E0305 09:39:20.456525    3097 docker_manager.go:2183] Failed to create pod infra container: ImagePullBackOff; Skipping pod "hello-minikube-3015430129-nxlgt_default(bfd41171-017c-11e7-9801-a63c1b79fdfb)": Back-off pulling image "gcr.io/google_containers/pause-amd64:3.0"
Mar 05 09:39:20 minikube localkube[3097]: E0305 09:39:20.456603    3097 pod_workers.go:184] Error syncing pod bfd41171-017c-11e7-9801-a63c1b79fdfb, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"gcr.io/google_containers/pause-amd64:3.0\""
Mar 05 09:39:35 minikube localkube[3097]: I0305 09:39:35.160486    3097 operation_executor.go:917] MountVolume.SetUp succeeded for volume "kubernetes.io/secret/bfd41171-017c-11e7-9801-a63c1b79fdfb-default-token-gg21h" (spec.Name: "default-token-gg21h") pod "bfd41171-017c-11e7-9801-a63c1b79fdfb" (UID: "bfd41171-017c-11e7-9801-a63c1b79fdfb").

I solved my issue by disabling macos firewall. It seems mac’s firewall avoids machines created with docker-machine-driver-xhyve to have network connectivity.

I also had to manually change the nameserver in /etc/resolv.conf to 8.8.8.8 (inside the minikube vm) to get name resolution working.

Note that I don’t have any of these issues using Docker for Mac normally, so they probably must have implemented some workarounds for these issues.