How to setup Kubernetes clustors in HTTP Proxy corporate environment

HTTP Proxy corporate environment for kubernetes can be fixed by including all my cluster node IPs in NO_PROXY and using the same NO_PROXY on all the minions when joining the cluster. In short…

kubeadm gets and checks environment from your currently running session. You can see what do you have if you execute $ env | grep -i _proxy= | sort. E.g. inside our company firewall I have something like this:

In order to setup Kubernetes clustors in HTTP Proxy corporate environment, we need to have http_proxy and https_proxy (lower and uppercase environment variables) pointing to the proxy server, and no_proxy set to IPs that should not go through the proxy server.

For this system, no_proxy had the host IP, 127.0.0.1, and then the IPs for the IPv4 pool and IPs for the service IPs. The defaults use large subnets, so Ankur reduced these to help make the no-proxy setting more manageable.

For the IPv4 pool, if using 192.168.0.0/24 (reduced size from default), and for the kubernetes service IP subnet, if using 10.96.0.0/24. these lines in .bashrc to create the no_proxy setting (gedit .bashrc):