#清理代理设置(运行时不再需要代理,删掉代理配置即可)
#如果不清理的话,后面使用containerd去下载镜像或者yum安装软件包的时候还会走代理设置。
#1、删除containerd的http代理(在每个节点执行)
[root@node-X ~]# ll /etc/systemd/system/containerd.service.d/http-proxy.conf
-rw-r--r--. 1 root root 288 Oct 31 17:06 /etc/systemd/system/containerd.service.d/http-proxy.conf
[root@node-X ~]# cat /etc/systemd/system/containerd.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=http://kxsw-1:7890" "HTTPS_PROXY=http://kxsw-1:7890" "NO_PROXY=172.16.1.21,node-1,node-1.cluster.local,172.16.1.22,node-2,node-2.cluster.local,172.16.1.23,node-3,node-3.cluster.local,127.0.0.1,localhost,10.200.0.0/16,10.233.0.0/16,svc,svc.cluster.local"
[root@node-X ~]# rm -f /etc/systemd/system/containerd.service.d/http-proxy.conf
[root@node-X ~]# ll /etc/systemd/system/containerd.service.d/http-proxy.conf
ls: cannot access /etc/systemd/system/containerd.service.d/http-proxy.conf: No such file or directory
[root@node-X ~]# systemctl daemon-reload
[root@node-X ~]# systemctl restart containerd
[root@node-X ~]# systemctl status containerd
#2、删除yum代理
[root@node-X ~]# grep 7890 -r /etc/yum*
/etc/yum.conf:proxy=http://kxsw-1:7890
/etc/yum.repos.d/containerd.repo:proxy=http://kxsw-1:7890
#分别修改
[root@node-X ~]# vim /etc/yum.conf
#注释
#proxy=http://kxsw-1:7890
#作者删除了此文件,我这里先本地备份,再删掉。
[root@node-X ~]# sz /etc/yum.repos.d/containerd.repo
[root@node-X ~]# rm -f /etc/yum.repos.d/containerd.repo
标题:Kubernetes(四)kubespray方式(4.4)清理代理设置
作者:yazong
地址:https://blog.llyweb.com/articles/2022/11/01/1667293708554.html