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

Propagate HTTP proxy config into VM #3242

Closed
cvila84 opened this issue Oct 10, 2018 · 7 comments · Fixed by #3834
Closed

Propagate HTTP proxy config into VM #3242

cvila84 opened this issue Oct 10, 2018 · 7 comments · Fixed by #3834
Assignees
Labels
area/networking networking issues cause/firewall-or-proxy When firewalls or proxies seem to be interfering help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.

Comments

@cvila84
Copy link

cvila84 commented Oct 10, 2018

BUG REPORT

Minikube version (use minikube version): v0.30.0

  • OS (e.g. from /etc/os-release): Windows
  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): Virtualbox
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): v0.30.0

What happened:
minikube start --kubernetes-version v1.10.8 --docker-env HTTP_PROXY=xxx --docker-env HTTPS_PROXY=xxx --docker-env NO_PROXY=xxx is failing in timeout during kubeadm command execution

sudo /usr/bin/kubeadm init --config /var/lib/kubeadm.yaml --ignore-preflight-errors=DirAvailable--etc-kubernetes-manifests --ignore-preflight-errors=DirAvailable--data-minikube --ignore-preflight-errors=Port-10250 --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-scheduler.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-apiserver.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-kube-controller-manager.yaml --ignore-preflight-errors=FileAvailable--etc-kubernetes-manifests-etcd.yaml --ignore-preflight-errors=Swap --ignore-preflight-errors=CRI  &&
sudo /usr/bin/kubeadm alpha phase addon kube-dns

.: Process exited with status 1

What you expected to happen:
minikube starts normally

Anything else do we need to know:
The faulty command is kubeadm alpha phase addon kube-dns. I replayed it inside the minikube VM to have more logs :

$ sudo kubeadm alpha phase addon kube-dns
unable to get URL "https://dl.k8s.io/release/stable-1.10.txt": Get https://dl.k8s.io/release/stable-1.10.txt: dial tcp 23.236.58.218:443: getsockopt: connection timed out

kubeadm is trying to download a file (that actually contains the exact version of kubernetes) but since HTTP proxy settings are not set in VM (they are only set for docker engine through --docker-env parameters), this is failing. I found that if you add --kubernetes-version, no download is done and the command succeeds:

$ sudo kubeadm alpha phase addon kube-dns --kubernetes-version v1.10.8
[addons] Applied essential addon: kube-dns

So a fix could be to propagate the --kubernetes-version passed to minikube start to kubeadm alpha phase addon kube-dns command.

@tstromberg tstromberg changed the title minikube no more starting when behind HTTP proxy kubeadm: process exited with status 1 behind proxy: unable to get URL "https://dl.k8s.io/release/stable-1.10.txt": connection timed out Oct 11, 2018
@tstromberg tstromberg added cause/firewall-or-proxy When firewalls or proxies seem to be interfering failed/kubeadm cause/poor-internet Failed due to internet access issues labels Oct 11, 2018
@llsousa
Copy link

llsousa commented Oct 14, 2018

What about to create a parameter on minikube start for proxy definition inside minikube VM? Something like:

minikube start --minikube-env http_proxy=url.to.http.proxy:http_port \
    --minikube-env https_proxy=url.to.http.proxy:http_port \
    --minikube-env no_proxy=localhost,127.0.0.1                

Will create the file /etc/profile.d/proxy.sh with the content:

export http_proxy=url.to.http.proxy:http_port
export https_proxy=url.to.http.proxy:http_port
export no_proxy=localhost,127.0.0.1

In order to use docker environment, sudo should be run with -E switch, like:

sudo -E  /usr/bin/kubeadm alpha phase addon kube-dns

All the CLI using sudo should use -E switch.

Please comment.

@tstromberg tstromberg added the kind/support Categorizes issue or PR as a support question. label Dec 4, 2018
@ldcastell
Copy link

ldcastell commented Dec 7, 2018

This issue is really annoying, will be awesome to see the fix go through :). Is there a workaround to this?

@tstromberg
Copy link
Contributor

@llsousa - That sounds reasonable. As a further iteration, it would be nice if we supported detecting the proxy from the environment, and automatically configured minikube appropriately.

"minikube start" should just work in every environment possible. If failing that, it should inform the user on the appropriate action necessary to fix the issue.

@tstromberg tstromberg removed co/kubeadm Issues relating to kubeadm co/kubeadm-2 cause/poor-internet Failed due to internet access issues labels Jan 22, 2019
@tstromberg tstromberg changed the title kubeadm: process exited with status 1 behind proxy: unable to get URL "https://dl.k8s.io/release/stable-1.10.txt": connection timed out Automatically propagate HTTP proxy config into VM Jan 23, 2019
@tstromberg tstromberg added kind/feature Categorizes issue or PR as related to a new feature. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete. and removed kind/support Categorizes issue or PR as a support question. labels Jan 23, 2019
@tstromberg tstromberg added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. area/networking networking issues labels Jan 24, 2019
@AdamKong
Copy link

See this is the same issue? this is on win10, with virtualbox Ubuntu OS.

C:\Windows\system32>minikube start
o minikube v0.34.0 on windows (amd64)

Creating virtualbox VM (CPUs=2, Memory=2048MB, Disk=20000MB) ...

  • "minikube" IP address is 192.168.99.130
  • Configuring Docker as the container runtime ...
  • Preparing Kubernetes environment ...
    @ Downloading kubelet v1.13.3
    @ Downloading kubeadm v1.13.3
    ! Failed to update cluster: downloading binaries: downloading kubeadm: Error downloading kubeadm v1.13.3: failed to download: failed to download to temp file: failed to create validator: failed to create validator: failed to download checksum file: Get https://storage.googleapis.com/kubernetes-release/release/v1.13.3/bin/linux/amd64/kubeadm.sha1: read tcp 192.168.1.107:52462->216.58.200.48:443: wsarecv: An existing connection was forcibly closed by the remote host.
  • Sorry that minikube crashed. If this was unexpected, we would love to hear from you:

Anyone can offer me a temp solution? Thanks much!

@tstromberg
Copy link
Contributor

@AdamKong - Your issue seems different, as the error is from outside of the VM environment. I'm pretty sure you just need to tell minikube about your proxy: https://github.com/kubernetes/minikube/blob/master/docs/http_proxy.md

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Sep 1, 2019
@tstromberg tstromberg changed the title Automatically propagate HTTP proxy config into VM Propagate HTTP proxy config into VM Sep 20, 2019
@tstromberg tstromberg added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 20, 2019
@tstromberg
Copy link
Contributor

I haven't heard any more user complaints on this, so I think we've done a good enough job on this. Closing until someone opens something more specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/networking networking issues cause/firewall-or-proxy When firewalls or proxies seem to be interfering help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/important-longterm Important over the long term, but may not be staffed and/or may need multiple releases to complete.
Projects
None yet
8 participants