minikube: hyperkit: VM is unable to access k8s.gcr.io (when VPN is in use)
Starting minikube with the default VM driver (Hyperkit) makes the external network unreachable:
minikube -p test start
đ [test] minikube v1.6.2 on Darwin 10.15.2
⨠Automatically selected the 'hyperkit' driver (alternates: [virtualbox vmwarefusion])
đĽ Creating hyperkit VM (CPUs=2, Memory=2000MB, Disk=20000MB) ...
â ď¸ VM is unable to access k8s.gcr.io, you may need to configure a proxy or set --image-repository
đł Preparing Kubernetes v1.17.0 on Docker '19.03.5' ...
đ Pulling images ...
â Unable to pull images, which may be OK: running cmd: "/bin/bash -c \"sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml\"": /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm config images pull --config /var/tmp/minikube/kubeadm.yaml": Process exited with
status 1
stderr: W0113 20:47:22.189603 2751 common.go:77] your configuration file uses a deprecated API spec: âkubeadm.k8s.io/v1beta1â. Please use âkubeadm config migrate --old-config old.yaml --new-config new.yamlâ, which will write the new, similar spec using a newer API version. W0113 20:47:22.190387 2751 common.go:77] your configuration file uses a deprecated API spec: âkubeadm.k8s.io/v1beta1â. Please use âkubeadm config migrate --old-config old.yaml --new-config new.yamlâ, which will write the new, similar spec using a newer API version. W0113 20:47:22.192219 2751 validation.go:28] Cannot validate kube-proxy config - no validator is available W0113 20:47:22.192254 2751 validation.go:28] Cannot validate kubelet config - no validator is available failed to pull image âk8s.gcr.io/kube-apiserver:v1.17.0â: output: Error response from daemon: Get https://k8s.gcr.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) , error: exit status 1 To see the stack trace of this error execute with --v=5 or higher
And then trying to deploy any pod fails.
Starting with --vmdriver virtualbox works just fine.
The exact command to reproduce the issue:
kube apply -f utils.yaml
utils.yaml pulls in massenz/dnsutils:1.1 image (but this is reproducible with any Docker image).
The full output of the command that failed:
Normal BackOff 30s kubelet, minikube Back-off pulling image âmassenz/dnsutils:1.1â Warning Failed 30s kubelet, minikube Error: ImagePullBackOff Normal Pulling 16s (x2 over 46s) kubelet, minikube Pulling image âmassenz/dnsutils:1.1â Warning Failed 1s (x2 over 31s) kubelet, minikube Failed to pull image âmassenz/dnsutils:1.1â: rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers) Warning Failed 1s (x2 over 31s) kubelet, minikube Error: ErrImagePull
The output of the minikube logs command:
The operating system version: MacOS 10.15.2
$ minikube version
minikube version: v1.6.2
commit: 54f28ac5d3a815d1196cd5d57d707439ee4bb392
About this issue
- Original URL
- State: open
- Created 4 years ago
- Reactions: 31
- Comments: 42 (6 by maintainers)
Commits related to this issue
- fixed kube.sh added https://github.com/kubernetes/minikube/issues/6296 — committed to jlim0930/scripts by deleted user 3 years ago
Using
--hyperkit-vpnkit-sock=autotries to use the VPNKit included with Docker Desktop. But the whole reason to go to minikube/hyperkit was to remove the dependency on Docker Desktop. Is there any way to use VPNKit without Desktop?We should update the error string to mention trying
--driver=dockerwhen a VPN is in use.At last it seems this issue is with the hyperkitVM, because It works fine with the virtual box. Those who want their pod to be up and running, without worrying about the type of VM, Can follow these steps
For those of us who have to use a Mac and Cisco AnyConnect- are there any options to resolve this? Perhaps installing vpn kit from source somehow?
Iâve yet to find an answer to this as well. Why do people like macs again? =) I hope one day our company opens up other options other than forcing macs, but for now I still have my trusty linux desktop that just works.
Running minikube alongside vpnkit on Mac seems to work, with a couple of gotchas.
Building vpnkit from source fails on originalâs repo (moby/vpnkit) and latest binaries are not available anywhere. In short, the Makefile for Mac build needs a bit of tweaking for opam dependencies. So I forked the original repo to build from source:
Then hyperkit Homebrewâs install also has a known issue, so we need to build that from source as well.
Once you have vpnkit and hyperkit, you can run:
And voilĂ ! Docker will run within minikubeâs hyperkit VM, through vpnkit.
But thereâs still a couple of connection error messages that have been bugging me for a few days when starting / restarting a new VM:
And on vpnkitâs output we can see:
Once VM is started everything appears to be fine though, could pull a few images and run basic docker commands. Havenât yet tested container to container networking, nor file mounts.
Iâm on mac and have to use the hyperkit driver for Ingress to work. I solved this VPN issue by adding the
--hyperkit-vpnkit-sock=autoflag tominikube start. This way it uses the VPNKit that ships with Docker for Mac. I found it here: https://minikube.sigs.k8s.io/docs/drivers/hyperkit/#special-features@vignesh-subburaj great. Iâm not sure what the cause of this issue is, so for now it seems our recommended advice is to try to use the docker driver instead of the hyperkit driver.
If anyone would be interested in updating our warning message from:
to something like
After turning on VPN, I canât pull image because canât connect to the internet so I just run by
export HTTPS_PROXY=192.168.64.1:9090 export HTTP_PROXY=192.168.64.1:9090 export NO_PROXY=localhost,127.0.0.1,10.96.0.0/12,192.168.59.0/24,192.168.39.0/24,192.168.64.0/24 minikube start
and the postman will start a proxy and listen on port 9090
Reference to https://minikube.sigs.k8s.io/docs/reference/networking/proxy/
Still an issue for me:
EDIT: I should add that no VPN is in use
Hi team I met the same error. Mac Mojave , version 10.14.6. run the command
minikube start --vm-driver=hyperkitto start the minikube, below is the logsI am using Ciso VPN, no matter i set the proxy or not, the result is the same.
Can get the dns log
I can get the some docker images inside the VM
But when i try to login the dockerhub, failed
Some article said it has relationship with the DNS
After kill the process, error still occurs. It seems a bug for minikube with hyperkit driver. How to fix this?
By the way,
dnsmasqwas causing issues for me:Minikube then runs without issues.
If you want to keep
dnsmasqinstalled then I would try these instructions: https://github.com/kubernetes/minikube/issues/3036#issuecomment-423150899With minikube on virtualbox, all good till the deployment. My Problem is, pods running NodeJS service canât connect to the external services (e.g. MongoDB Atlas). Note: I have deployed on DigitalOcen, the same docker build work perfectly fine.
2020-02-24 17:05:02 [ info ] : server started on port 3333 (local) Error: Error: querySrv ENOTFOUND _mongodb._tcp.twrdev-hokqm.mongodb.net at NativeConnection.<anonymous> (/usr/src/app/services/mongoose.js:57:19) at NativeConnection.emit (events.js:196:13) at NativeConnection.EventEmitter.emit (domain.js:471:20) at /usr/src/app/node_modules/mongoose/lib/connection.js:817:37 at processTicksAndRejections (internal/process/task_queues.js:82:9) 2020-02-24 17:05:02 [ error ] : Error connecting to DB : querySrv ENOTFOUND _mongodb._tcp.twrdev-hokqm.mongodb.net Error: querySrv ENOTFOUND _mongodb._tcp.twrdev-hokqm.mongodb.net at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:19) { errno: âENOTFOUNDâ, code: âENOTFOUNDâ, syscall: âquerySrvâ, hostname: â_mongodb._tcp.twrdev-hokqm.mongodb.netâ } [Unhandled Rejection] Node NOT Exiting⌠Error: Could not connect to database at NativeConnection.<anonymous> (/usr/src/app/services/mongoose.js:70:19) at NativeConnection.emit (events.js:196:13) at NativeConnection.EventEmitter.emit (domain.js:471:20) at NativeConnection.set (/usr/src/app/node_modules/mongoose/lib/connection.js:125:12) at /usr/src/app/node_modules/mongoose/lib/connection.js:711:26 at executeCallback (/usr/src/app/node_modules/mongodb/lib/operations/execute_operation.js:74:5) at /usr/src/app/node_modules/mongodb/lib/operations/connect.js:209:23 at /usr/src/app/node_modules/mongodb/lib/operations/connect.js:299:21 at QueryReqWrap.callback (/usr/src/app/node_modules/mongodb/lib/core/uri_parser.js:56:21) at QueryReqWrap.onresolve [as oncomplete] (dns.js:203:10) 2020-02-24 17:05:02 [ error ] : Disconnected from Database! Any suggestion?? Thanks in advance
On my machine is some corporate software (cisco security, vpn) running and I got it working by starting
vpnkitalong withminikube:BTW k8s.gcr.io is deprecated as a source of container images
minikube start --hyperkit-vpnkit-sock=autoworks for me. I found when close Cisco VPN client and minikube hyperkit VM canât access internet. I try to turn off and then of Mac network, the VM can access internet again.Iâm also seeing this, trying to run on a Mac that has a âCisco Anconnectâ VPN software and hyperkit ⌠the easiest workaround is to use the --vm-driver=virtualbox option. Iâm happy to provide config information if anyone really wants the details however my gut feeling is that the corporate installed Cisco VPN software is the culprit, it futzes with DNS even when its not âturned onâ to ensure Iâm not accessing âinappropriateâ websites like say ⌠urban dictionary (I know, it seems unreasonable, but thats just collateral damage for a decent security posture so I put up with it).
For hyperkit,
VM is unable to access k8s.gcr.iosays to me that this is likely a DNS issue, and likely #3036Do you mind sharing the output of the following two commands for me?
sudo lsof -i4UDP:53 -P -nps -afe | grep dnsThank you!
Yes, Docker works just fine (with/without login) Yes, I use a VPN (hopefully everyone does, these daysâŚ) but the problem persists with/without VPN.
Yep, the
docker loginwas the first thing I tried as I assumed that would have been the case; but really, the problem must be around the egress network for the hyperkit VM: as mentioned, when I use--vm-driver virtualboxit works just fine; VBox, by default, creates a bridge and allows egress to the Internet for the VM, Iâm guessing Hyperkit doesnât, and as the VM is on a separate subnet than the host network, then it doesnât know how to reach the external network.BTW - this seems to be a good place to remark how awesome
Minikubeis - I absolutely love it, it has helped me immensely in exploring K8s, developing a whole stack of services, and generally making my developerâs life so much easier: thank you deeply to the contributors!