kubectl apply -f behind proxy

7/13/2018

I am able to install kubernetes using kubeadm method successfully. My environment is behind a proxy. I applied proxy to system, docker and I am able to pull images from Docker Hub without any issues. But at the last step where we have to install the pod network (like weave or flannel), its not able to connect via proxy. It gives a time out error. I am just checking to know if there is any command like curl -x http:// command for kubectl apply -f? Until I perform this step it says the master is NotReady.

-- ravi karthik bodicherla
docker
kubeadm
kubernetes

1 Answer

7/13/2018

When you do work with a proxy for internet access, do not forget to configure the NO_PROXY environment variable, in addition of HTTP(S)_PROXY.

See this example:

NO_PROXY accepts a comma-separated list of hosts, IP addresses, or IP ranges in CIDR format:

For master hosts

  • Node host name
  • Master IP or host name

For node hosts

  • Master IP or host name

For the Docker service

  • Registry service IP and host name

See also for instance weaveworks/scope issue 2246.

-- VonC
Source: StackOverflow