crc: [BUG] crc couldn't resolve domains even with "-n 8.8.8.8" flag
General information
- OS: macOS
- Hypervisor: hyperkit
- Did you run
crc setupbefore starting it (Yes/No)? Yes
CRC version
# Put `crc version` output here
crc version: 1.9.0+a68b5e0
OpenShift version: 4.3.10 (embedded in binary)
CRC status
# Put `crc status` output here
CRC VM: Running
OpenShift: Running (v4.3.10)
Disk Usage: 15.54GB of 32.72GB (Inside the CRC VM)
Cache Usage: 12.09GB
Cache Directory: /Users/brightzheng/.crc/cache
CRC config
# Put `crc config view` output here
nothing customized so no output
Steps to reproduce
- provision CRC
crc start -c 4 -m 8192 -p pullsecret -n 8.8.8.8 --log-level debug
- ssh into the VM & test – note: no
8.8.8.8in/etc/resolv.conf:
ssh -i ~/.crc/machines/crc/id_rsa core@"$(crc ip)"
[core@crc-bq5fv-master-0 ~]$ cat /etc/resolv.conf
# Generated by CRC
search crc.testing
nameserver 10.88.0.8
nameserver 192.168.64.1
nameserver fe80::10cf:80e8:f43c:3191%enp0s1
[core@crc-bq5fv-master-0 ~]$ nc -vz quay.io 443
Ncat: Version 7.70 ( https://nmap.org/ncat )
Ncat: Could not resolve hostname "quay.io": Name or service not known. QUITTING.
[core@crc-bq5fv-master-0 ~]$ exit
- deploy and test
$ eval $(crc oc-env)
$ oc login -u kubeadmin -p $KUBEADMIN_PASSWORD https://api.crc.testing:6443
$ oc run nginx --image=bitnami/nginx
$ oc get pod
NAME READY STATUS RESTARTS AGE
nginx-7b4746f4d-tgvlc 0/1 ImagePullBackOff 0 2m54s
$ oc describe pod nginx-7b4746f4d-tgvlc
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled <unknown> default-scheduler Successfully assigned open-cluster-management/nginx-7b4746f4d-tgvlc to crc-bq5fv-master-0
Warning Failed 19s kubelet, crc-bq5fv-master-0 Failed to pull image "bitnami/nginx": rpc error: code = Unknown desc = error pinging docker registry registry-1.docker.io: Get https://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on [fe80::10cf:80e8:f43c:3191%enp0s1]:53: read udp [fe80::dca0:13a6:55f9:4ab9%enp0s1]:35790->[fe80::10cf:80e8:f43c:3191%enp0s1]:53: read: connection refused
Warning Failed 19s kubelet, crc-bq5fv-master-0 Error: ErrImagePull
Normal BackOff 19s kubelet, crc-bq5fv-master-0 Back-off pulling image "bitnami/nginx"
Warning Failed 19s kubelet, crc-bq5fv-master-0 Error: ImagePullBackOff
Normal Pulling 7s (x2 over 2m20s) kubelet, crc-bq5fv-master-0 Pulling image "bitnami/nginx"
Expected
The 8.8.8.8 should be used to update /etc/resolv.conf and the sample deploy should work properly without any ImagePullBackOff issue.
Actual
No access to the Internet.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 17 (11 by maintainers)
FYI @praveenkumar:
Finally, I know where the bug is and how to fix it.
We need to make the resolver precise like this:
After this changes, everything works perfectly fine! Hope this helps someone who is running
dnsmasquelocally in the CRC host.