Reputation: 837
Behind the enterprise proxy,
what is the proper setting for kubernetes (and docker)?
export http_proxy="http://1.2.3.4:8080"
or
export http_proxy=http://1.2.3.4:8080
or
export http_proxy=1.2.3.4:8080
Should I set capital environment variable like HTTP_PROXY ?
When I set no_proxy,
export no_proxy=10.0.0.1,10.0.0.2,10.0.0.3
(all the kubernetes master and nodes )
or
export no_proxy=10.0.0.*
Should I setting below file ?
$ vi /etc/systemd/system/docker.service.d/http-proxy.conf [Service] Environment="HTTP_PROXY=http://1.2.3.4:8080" "HTTPS_PROXY=http://1.2.3.4:8080" "NO_PROXY=127.0.0.1,localhost,10.0.0.1,10.0.0.2,10.0.0.3"
In this file, applied same rule with above question?
Thanks inadvance.
Upvotes: 4
Views: 2069
Reputation: 31
we will add the proxy in both /etc/environment file and docker.service file
In /etc/environment
export http_proxy=http://10.169.33.81:8080/
export https_proxy=http://10.169.33.81:8080/
export no_proxy="127.0.0.1,localhost,(added all the worker node server ip)"
export NO_PROXY=$no_proxy
In docker.service file
Environment="HTTP_PROXY=http://10.x.x.x:8080/"
Environment="HTTPS_PROXY=http://10.x.x.x:8080/"
Environment="NO_PROXY=127.0.0.1,0.0.0.0"
Upvotes: 0
Reputation: 2115
We always include the scheme in our environment variables.
/etc/profile.d/proxy.sh:
#!/bin/bash
export http_proxy=http://<proxy>:3128
export https_proxy=$http_proxy
export no_proxy=169.254.169.254,localhost,127.0.0.1
export HTTP_PROXY=$http_proxy
export HTTPS_PROXY=$https_proxy
export NO_PROXY=$no_proxy
/etc/systemd/system/docker.service.d/proxy.conf:
[Service]
Environment="HTTPS_PROXY=https://<proxy>:3128/" "HTTP_PROXY=http://<proxy>:3128/"
Upvotes: 4