最近在k8s上部署helm 老提示无法下载镜像,因为伟大的祖国的长城Firewall....导致k8s根本玩不了.....
第一步:配置系统代理
# vim .bashrc
export http_proxy=http://proxy:8080
export https_proxy=http://proxy:8080
export no_proxy=172.16.65.0/,127.0.0.1,localhost,10.244.0.0/,172.17.0.0/,10.96.0.0/
第二步:配置Docker代理
mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://proxy:8080" "NO_PROXY=172.16.65.0/24,127.0.0.1,localhost,10.244.0.0/16,172.17.0.0/16,10.96.0.0/12"
重启服务
systemctl daemon-reload
systemctl restart docker
确认配置生效
systemctl show docker --property Environment