Closed chaimleib closed 5 years ago
Possibly related: images also could not be fetched when I tried using minikube dashboard
to create a new app using nginx:alpine
, nginx
, docker.io/library/nginx:alpine
, or k8s.gcr.io/nginx:alpine
.
Failed to pull image "nginx:alpine": rpc error: code = Unknown desc = Error response from daemon: 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.2:57706->192.168.64.1:53: read: connection refused
All the failure messages from the minikube dashboard
GUI were the same, just with different image names.
Also possibly related:
Here are some diagnostic commands:
% sudo lsof -ni:53
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnscrypt- 67702 nobody 7u IPv4 0xd11075e49a67bfd7 0t0 UDP 127.0.0.1:domain
dnscrypt- 67702 nobody 8u IPv4 0xd11075e4950047c7 0t0 TCP 127.0.0.1:domain (LISTEN)
% ps -afe | grep dns
0 67041 1 0 10:00AM ?? 0:13.82 /Library/Application Support/OpenDNS Roaming Client/dns-updater
-2 67702 1 0 10:43AM ?? 0:05.57 /Library/Application Support/OpenDNS Roaming Client/dnscrypt-proxy --user nobody --local-address=127.0.0.1:53 --plugin=/Library/Application Support/OpenDNS Roaming Client/libdcplugin_erc.so -d
502 82384 25295 0 11:32AM ttys007 0:00.01 grep dns
% hyperkit -v
hyperkit: 0.20190201
Homepage: https://github.com/docker/hyperkit
License: BSD
% ls -la /usr/local/bin/docker-machine-driver-hyperkit
-rwsr-xr-x 1 root wheel 33224740 Jun 24 18:35 /usr/local/bin/docker-machine-driver-hyperkit
% grep -c minikube /usr/local/bin/docker-machine-driver-hyperkit
93
% docker pull nginx:alpine
alpine: Pulling from library/nginx
e7c96db7181b: Pull complete
f0e40e45c95e: Pull complete
Digest: sha256:b126fee6820be927b1e04ae36b3f51aa47d9b73bf6b1826ff19a59d22b2b4c63
Status: Downloaded newer image for nginx:alpine
% curl -vvv https://k8s.gcr.io/v2/
* Trying 74.125.142.82...
* TCP_NODELAY set
* Connected to k8s.gcr.io (74.125.142.82) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
* successfully set certificate verify locations:
* CAfile: /etc/ssl/cert.pem
CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-ECDSA-CHACHA20-POLY1305
* ALPN, server accepted to use h2
* Server certificate:
* subject: C=US; ST=California; L=Mountain View; O=Google LLC; CN=*.gcr.io
* start date: Jun 11 12:40:53 2019 GMT
* expire date: Sep 3 12:21:00 2019 GMT
* subjectAltName: host "k8s.gcr.io" matched cert's "*.gcr.io"
* issuer: C=US; O=Google Trust Services; CN=Google Internet Authority G3
* SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fa670006600)
> GET /v2/ HTTP/2
> Host: k8s.gcr.io
> User-Agent: curl/7.54.0
> Accept: */*
>
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 401
< docker-distribution-api-version: registry/2.0
< www-authenticate: Bearer realm="https://k8s.gcr.io/v2/token",service="k8s.gcr.io"
< content-type: application/json
< date: Tue, 25 Jun 2019 18:28:52 GMT
< server: Docker Registry
< cache-control: private
< x-xss-protection: 0
< x-frame-options: SAMEORIGIN
< alt-svc: quic=":443"; ma=2592000; v="46,44,43,39"
< accept-ranges: none
< vary: Accept-Encoding
<
* Connection #0 to host k8s.gcr.io left intact
{"errors":[{"code":"UNAUTHORIZED","message":"Unauthorized access."}]}
I am curious, are you trying to pull image to minikube? have you done minikube docker-env ? are you behind a proxy that limits your access to GCR?
I wonder if this is related to this https://github.com/kubernetes/minikube/issues/4547
I was able to get things working using --vm-driver parallels
, so the proxy seems to allow connections to the registry.
I wonder if this is related to this #4547
@medyagh for me, I start minikube without --insecure-registry, with or without HTTP_PROXY, HTTPS_PROXY,
docker pull in minikube ssh
minikube ssh
_ _
_ _ ( ) ( )
___ ___ (_) ___ (_)| |/') _ _ | |_ __
/' _ ` _ `\| |/' _ `\| || , < ( ) ( )| '_`\ /'__`\
| ( ) ( ) || || ( ) || || |\`\ | (_) || |_) )( ___/
(_) (_) (_)(_)(_) (_)(_)(_) (_)`\___/'(_,__/'`\____)
$ docker pull alpine
Using default tag: latest
Error response from daemon: 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.96:50393->192.168.64.1:53: read: connection refused
$ curl -v -I google.com
* Could not resolve host: google.com
curl: (6) Could not resolve host: google.com
can't pull alpine images on docker hub, needless to say images on gcr.io.
how dns work in minikube ? can't find any documentation.
by the way. on macOS version 10.14.5, minikube version 1.2.0, hyperkit driver
didn't try other driver yet ....
I don't have HTTP_PROXY
or http_proxy
set in my env vars.
See https://github.com/kubernetes/minikube/issues/3036#issuecomment-511028576 on issue #3036. Cisco Umbrella and Cisco Anyconnect may run a local DNS proxy which does not seem to work with Hyperkit and minikube. I am not using any sort of HTTP proxy.
A temporary workaround for me is to use the parallels vm-driver. I do not experience this issue with Parallels. I did not test Virtualbox or VMware.
I found out that I had dnsmasq running on my Mac. Aber disabling it, I downloaded the newest hyperkit driver, deleted the exisiting minikube and set up a new minikube. Now everything works as expected.
brew services stop dnsmasq
curl -LO https://storage.googleapis.com/minikube/releases/latest/docker-machine-driver-hyperkit && sudo install -o root -g wheel -m 4755 docker-machine-driver-hyperkit /usr/local/bin/
minikube delete -p minikube
minikube start --memory 16384 --cpus 4 --vm-driver=hyperkit --disk-size 100g
Hopefully this helps someone.
@chaimleib - any chance there is a local DNS server running on your system? You can confirm using:
sudo lsof -i :53
If so, this is due to #3036
@chaimleib could you confirm the output of sudo lsof -i :53
Copying from above:
% sudo lsof -ni:53
Password:
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
dnscrypt- 67702 nobody 7u IPv4 0xd11075e49a67bfd7 0t0 UDP 127.0.0.1:domain
dnscrypt- 67702 nobody 8u IPv4 0xd11075e4950047c7 0t0 TCP 127.0.0.1:domain (LISTEN)
-n
just means not to resolve hostnames.
Thanks for the info! It does appear that you have a DNS server (dnscrypt) which conflicts with the hyperkit DNS server. You can either use VirtualBox or kill the dnscrypt process before hand.
Closing as dupe of #3036
I'm having trouble fetching docker images using hyperkit. This affects the initial minikube start command logged below, where it says "Unable to pull images..."
The exact command to reproduce the issue:
The full output of the command that failed:
The output of the
minikube logs
command:The operating system version: macOS 10.14.5