Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

none: VM is unable to access k8s.gcr.io -> exceeded while awaiting headers #6070

Closed
Syncma opened this issue Dec 12, 2019 · 15 comments
Closed
Labels
co/none-driver kind/support Categorizes issue or PR as a support question. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@Syncma
Copy link

Syncma commented Dec 12, 2019

[root@laptop ~]# minikube start --vm-driver=none
😄 minikube v1.6.1 on Fedora 29
✨ Selecting 'none' driver from user configuration (alternates: [])
🤹 Running on localhost (CPUs=8, Memory=7735MB, Disk=15054MB) ...
ℹ️ OS release is Fedora 29 (Workstation Edition)
⚠️ 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.4' ...
💾 Downloading kubelet v1.17.0
💾 Downloading kubeadm v1.17.0
🚜 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": exit status 1
stdout:

stderr:
W1212 11:02:01.365969 19837 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.
W1212 11:02:01.366538 19837 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.
W1212 11:02:01.368659 19837 validation.go:28] Cannot validate kubelet config - no validator is available
W1212 11:02:01.368670 19837 validation.go:28] Cannot validate kube-proxy 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

🚀 Launching Kubernetes ...

💣 Error starting cluster: init failed. cmd: "/bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap"": /bin/bash -c "sudo env PATH=/var/lib/minikube/binaries/v1.17.0:$PATH kubeadm init --config /var/tmp/minikube/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests,DirAvailable--var-lib-minikube,DirAvailable--var-lib-minikube-etcd,FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml,FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml,FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml,FileAvailable--etc-kubernetes-manifests-etcd.yaml,Port-10250,Swap": exit status 1
stdout:
[init] Using Kubernetes version: v1.17.0
[preflight] Running pre-flight checks
[preflight] Pulling images required for setting up a Kubernetes cluster
[preflight] This might take a minute or two, depending on the speed of your internet connection
[preflight] You can also perform this action in beforehand using 'kubeadm config images pull'

stderr:
W1212 11:02:16.549054 20140 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.
W1212 11:02:16.549673 20140 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.
W1212 11:02:16.551904 20140 validation.go:28] Cannot validate kube-proxy config - no validator is available
W1212 11:02:16.551914 20140 validation.go:28] Cannot validate kubelet config - no validator is available
[WARNING Firewalld]: firewalld is active, please ensure ports [8443 10250] are open or your cluster may not function correctly
[WARNING Service-Docker]: docker service is not enabled, please run 'systemctl enable docker.service'
[WARNING IsDockerSystemdCheck]: detected "cgroupfs" as the Docker cgroup driver. The recommended driver is "systemd". Please follow the guide at https://kubernetes.io/docs/setup/cri/
[WARNING Swap]: running with swap on is not supported. Please disable swap
[WARNING FileExisting-socat]: socat not found in system path
[WARNING Hostname]: hostname "minikube" could not be reached
[WARNING Hostname]: hostname "minikube": lookup minikube on 192.168.43.33:53: no such host
[WARNING Service-Kubelet]: kubelet service is not enabled, please run 'systemctl enable kubelet.service'
error execution phase preflight: [preflight] Some fatal errors occurred:
[ERROR ImagePull]: 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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-controller-manager: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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-scheduler: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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/kube-proxy: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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/pause:3.1: 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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/etcd:3.4.3-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
[ERROR ImagePull]: failed to pull image k8s.gcr.io/coredns:1.6.5: 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
[preflight] If you know what you are doing, you can make a check non-fatal with --ignore-preflight-errors=...
To see the stack trace of this error execute with --v=5 or higher

😿 Sorry that minikube crashed. If this was unexpected, we would love to hear from you:
👉 https://github.com/kubernetes/minikube/issues/new/choose

@henzeb
Copy link

henzeb commented Dec 12, 2019

Be aware that kubernetes v1.17.0 supports up to Docker 18.09.9.

you should downgrade to that version.

On ubuntu/debian: remove docker, use the official repo and execute the following:
apt-get install docker-ce*=5:18.09.9~3-0~ubuntu-bionic

@afbjorklund
Copy link
Collaborator

Be aware that kubernetes v1.17.0 supports up to Docker 18.09.9.

That is not true, Kubernetes 1.17 supports Docker 19.03 in kubeadm

You should probably use Docker 18.09.11 if you want to use the older

@henzeb
Copy link

henzeb commented Dec 12, 2019

Be aware that kubernetes v1.17.0 supports up to Docker 18.09.9.

That is not true, Kubernetes 1.17 supports Docker 19.03 in kubeadm

You should probably use Docker 18.09.11 if you want to use the older

You are right. The changelogs at kubernetes.io aren't updated. I saw 1.17 in the topcorner, so I assumed I was looking at 1.17 changelogs. but still, I couldn't get minikube to work with the newer docker version.

@afbjorklund
Copy link
Collaborator

We don’t have any CI tests for Fedora/CentOS yet, unfortunately.

A common problem is SELinux, though

@tstromberg tstromberg changed the title unable to start on Fedora 29 none: VM is unable to access k8s.gcr.io Dec 16, 2019
@tstromberg
Copy link
Contributor

tstromberg commented Dec 16, 2019

This appears to be a network configuration issue, based on the warning and errors emitted:

⚠️ VM is unable to access k8s.gcr.io, you may need to configure a proxy or set --image-repository

. Can you please confirm that the following works on your host:

curl https://k8s.gcr.io/

If it does not, you may have to pass an argument to --image-repository or --image-mirror-country.

@tstromberg tstromberg added co/none-driver triage/needs-information Indicates an issue needs more information in order to work on it. kind/support Categorizes issue or PR as a support question. labels Dec 16, 2019
@vikas86
Copy link

vikas86 commented Dec 24, 2019

Tried - curl https://k8s.gcr.io/
It doesn't throw any error though.
Facing similar issue while starting minikube on my windows machine.
Can you provide an explicit solution or a stopgap solution to resolve this issue.

@vikas86
Copy link

vikas86 commented Dec 24, 2019

PS C:\Windows\system32> minikube start --vm-driver=hyperv

  • minikube v1.6.1 on Microsoft Windows 10 Pro 10.0.17763 Build 17763
  • Selecting 'hyperv' driver from user configuration (alternates: [])
  • Creating hyperv 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
    stdout:

stderr:
W1224 06:49:16.080769 3673 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.
W1224 06:49:16.081889 3673 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.
W1224 06:49:16.084063 3673 validation.go:28] Cannot validate kube-proxy config - no validator is available
W1224 06:49:16.084132 3673 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

  • Launching Kubernetes ...
  • Waiting for cluster to come online ...
  • Done! kubectl is now configured to use "minikube"
    ! C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe is version 1.10.3, and is incompatible with Kubernetes 1.17.0. You will need to update C:\Program Files\Docker\Docker\Resources\bin\kubectl.exe or use 'minikube kubectl' to connect with this cluster
    PS C:\Windows\system32>

@vikas86
Copy link

vikas86 commented Dec 30, 2019

Got a solution for this issue.
For minikube to pull images it needs to have a public network connection which can be created by Virtual switch in HyperV.

  • In HyperV create a virtual network switch (type external) - all dfault settings.
    In windows powershell:

minikube start --vm-driver hyperv --hyperv-virtual-switch "My Virtual Switch"

Solves below issues while starting minikube:
Ths issue - VM is unable to access k8s.gcr.io
- Unable to pull images,

@hisergiorojas
Copy link

When I run curl https://k8s.gcr.io/

the output:

<TITLE>302 Moved</TITLE>

302 Moved

The document has moved here.

@jasperf
Copy link

jasperf commented Feb 4, 2020

I have the same 302 when I check as @hisergiorojas . Starting Minikube I have

minikube start                                                                     
😄  minikube v1.6.2 on Darwin 10.15.2
✨  Selecting 'hyperkit' driver from existing profile (alternates: [virtualbox])
💡  Tip: Use 'minikube start -p <name>' to create a new cluster, or 'minikube delete' to delete this one.
🔄  Starting existing hyperkit VM for "minikube" ...
⌛  Waiting for the host to be provisioned ...
⚠️  VM may be unable to resolve external DNS records
⚠️  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' ...
🚀  Launching Kubernetes ... 
^C

And trying the Virtual Switch I get

Minikube start --vm-driver hyperv --hyperv-virtual-switch "My Virtual Switch"
😄  minikube v1.6.2 on Darwin 10.15.2
✨  Selecting 'hyperv' driver from user configuration (alternates: [virtualbox])
💣  The driver 'hyperv' is not supported on darwin

@jasperf
Copy link

jasperf commented Feb 4, 2020

In the end for me it was dnsmasq messing with my connection. Turning it off solved the issue.

@bmantoni
Copy link

Having the issue too.
minikube v1.7.2 on Darwin 10.14.6
hyperkit

I've tried deleting and recreating the kube, and on different networks. I get the 302 when curling the URL.

@lily524
Copy link

lily524 commented Feb 17, 2020

I met the same problem when using hyperkit as driver. Delete minikube and use another driver(e.g. virtualbox) is a quick solution.

@tstromberg tstromberg changed the title none: VM is unable to access k8s.gcr.io none: VM is unable to access k8s.gcr.io -> exceeded while awaiting headers Mar 18, 2020
@tstromberg tstromberg added the needs-solution-message Issues where where offering a solution for an error would be helpful label Mar 18, 2020
@tstromberg
Copy link
Contributor

Closing. I believe this was due to running in China, where --image-mirror-country=cn is required.

@mitloshuk
Copy link

@tstromberg i have same problem

  • OS: MacOS Mojave 10.14.6
  • Minikube version: v1.9.0
  • ISO: minikube-v1.9.0.iso
  • VM Driver: hyperkit
  • Install tool: brew
  • dnsmasq: not installed

Pinging of any domain OR host ping 192.168.99.1 -c 180 gives me

$ ping google.com -c 180 PING google.com (172.217.19.238): 56 data bytes

--- google.com ping statistics ---
180 packets transmitted, 0 packets received, 100% packet loss

@tstromberg tstromberg removed the needs-solution-message Issues where where offering a solution for an error would be helpful label Apr 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/none-driver kind/support Categorizes issue or PR as a support question. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

10 participants