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

Feature Request: Add support for HTTP_PROXY and HTTPS_PROXY to minikube #2453

Closed
amandadebler opened this issue Jan 24, 2018 · 10 comments
Closed
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@amandadebler
Copy link

amandadebler commented Jan 24, 2018

minikube allows passing HTTP_PROXY and HTTPS_PROXY as Docker environment variables, but that only affects the machine once it exists; it does not help with the initial setup. It apparently ignores the Windows HTTP_PROXY and HTTPS_PROXY environment variables.

This is a problem for users in corporate environments behind Windows-authenticating web proxies.

I attempted a workaround by turning off caching and pointing to localkube and minikube.iso, which installed a minikube VM, but I'm still having odd issues: minikube ssh connects to the machine, but minikube dashboard fails because the kubeconfig cannot be created ("auth info "minikube" does not exist)

Having minikube observe Windows' HTTP_PROXY and HTTPS_PROXY, or allowing them to be passed in would prevent a lot of the issues corporate users have trying to install minikube.

Environment:

  • Windows 10 Enterprise 1607
  • Bluecoat Web Proxy
  • Fiddler as local proxy (works with Docker for Windows)

Minikube version (use minikube version): v0.24.1

  • OS (e.g. from /etc/os-release):
    (of the minikube VM)
    NAME=Buildroot
    VERSION=2017.02
    ID=buildroot
    VERSION_ID=2017.02
    PRETTY_NAME="Buildroot 2017.02"

(of the host PC)
Windows 10 Enterprise Version 1607

  • VM Driver (e.g. cat ~/.minikube/machines/minikube/config.json | grep DriverName): hyperv
  • ISO version (e.g. cat ~/.minikube/machines/minikube/config.json | grep -i ISO or minikube ssh cat /etc/VERSION): v0.23.6
  • Install tools:
  • Others:
    Fiddler v4, set to listen on port 8888 to remote hosts

What happened:

minikube fails completely without the pre-loaded files, and running with the pre-loaded files and no internet access created a semi-accessible minikube VM in Hyper-V, with an IPv6 IP address.

What you expected to happen:
minikube would use HTTP_PROXY and/or HTTPS_PROXY to get all additional installation items (ISOs, image repositories). The install method I used did not configure the VM switch interface and the minikube VM with IP addresses in 192.168.99.0/24; the minikube VM has an IPv6 address that causes problems for kubectl.

How to reproduce it (as minimally and precisely as possible):
From behind an NTLM-authenticating web proxy, start Fiddler, open PowerShell with "Run As Administrator", check that HTTP_PROXY and HTTPS_PROXY are set to http://192.168.7.56:8888 (192.168.7.56 being your PC's current IP address), the ISO and localkube are in the locations given in the following command, and run:

minikube start --vm-driver="hyperv" --memory=2048 --hyperv-virtual-switch="MinikubeSwitch" --docker-env "HTTP_PROXY=http://192.168.7.56:8888" --docker-env "HTTPS_PROXY=http://192.168.7.56:8888" --v=7 --alsologtostderr --kubernetes-version "file:///users/someuser/downloads/localkube-linux-amd64" --cache-images=false --iso-url "file:///users/someuser/downloads/minikube-v0.23.6.iso"

Output of minikube logs (if applicable):
-- No entries-- (as in, there really isn't anything there)

I have attached the output from my minikube start command (sanitized with 'someuser' as the Windows user, and 'SomePCName' as the host PC name)

Minikube-Install.txt

Anything else do we need to know:
I set the kubeconfig manually as in #1943, and when I ran kubectl cluster-info, I got "Unable to connect to the server: dial tcp: too many colons in address fe80::215:5dff:fee4:8f35" (trouble with IPv6, apparently).

@r2d4 r2d4 added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 24, 2018
@r2d4
Copy link
Contributor

r2d4 commented Jan 24, 2018

This sounds good to me - minikube should respect those environment variables for the items its downloads as part of the provisioning process outside the VM.

@davidmichaelkarr
Copy link

Would this issue cause minikube to fail to download public images on Docker Hub? I'm seeing that symptom behind our firewall. The "describe" output simply says the connection attempt timed out. I was told that I had to add "--docker-env" parameters to set those variables, but that didn't make any difference, and I think that's because applying those variables to the docker container is too late.

@davidmichaelkarr
Copy link

You probably can ignore my last comment, as I discovered that I had to do "minikube delete" (not just "minikube stop") to reset everything before using the "--docker-env" settings.

@davidmichaelkarr
Copy link

Hmm, but does minikube support IP address ranges with CIDR in the no_proxy variable? I started my minikube VM with no_proxy set to "192.168.0.0/16". I was able to download my image from docker hub and start the container, and I was apparently able to start a LoadBalancer for it, but when I tried to get the host and port with "minikube service kubia-http", I got the following: "Error opening service: Could not find finalized endpoint being pointed to by kubia-http: Error validating service: Error getting service kubia-http: Get https://192.168.99.100:8443/api/v1/namespaces/default/services/kubia-http: Proxy Authentication Required"

@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 Apr 25, 2018
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

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 rotten
/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels May 25, 2018
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

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

@flmmartins
Copy link

flmmartins commented Jun 26, 2018

/reopen

I tried to do the same. I was not able to start minikube with proxy. I used:
minikube.exe start --vm-driver=virtualbox --docker-env http_proxy=$http_proxy --docker-env https_proxy=$https_proxy --docker-env no_proxy=192.168.99.0/24

E0626 14:58:52.551094 19016 start.go:299] Error restarting cluster: restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition

I then tried the kubectl proxy command from: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api

Still not working. Minikube is v0.28.0

@k8s-ci-robot
Copy link
Contributor

@flmmartins: you can't re-open an issue/PR unless you authored it or you are assigned to it.

In response to this:

/reopen

I tried to do the same. I was not able to start minikube with proxy. I used:
minikube.exe start --vm-driver=virtualbox --docker-env http_proxy=$http_proxy --docker-env https_proxy=$https_proxy --docker-env no_proxy=192.168.99.0/24

E0626 14:58:52.551094 19016 start.go:299] Error restarting cluster: restarting kube-proxy: waiting for kube-proxy to be up for configmap update: timed out waiting for the condition

I then tried the kubectl proxy command from: https://kubernetes.io/docs/tasks/access-application-cluster/access-cluster/#directly-accessing-the-rest-api

Still not working.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@medyagh
Copy link
Member

medyagh commented Jun 26, 2019

@flmmartins thank you for reporting this, I will watch this issue in #4600 please follow that issue and I hope we will resolve this issue soon.

@medyagh medyagh closed this as completed Jun 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

7 participants