自学k8s-安装过程为下载flannel.yml和镜像文件,而需要设置的代理

1、yum代理设置
编辑文件为:/etc/yum.conf
在里面添加这一行:proxy=IP:PORT
这里的IP 为你要设置的IP ,PORT 是你要设置的端口

2、wget的代理设置

用vi/vim编辑器打开/etc/wgetrc,找到代理设置所在行,然后追加如下内容:
# You can set the default proxies for Wget to use for http, https, and ftp.
# They will override the value in the environment.
#https_proxy = http://proxy.yoyodyne.com:18023/
#http_proxy = http://proxy.yoyodyne.com:18023/
#ftp_proxy = http://proxy.yoyodyne.com:18023/
添加下面两行:
http_proxy = IP:PORT
ftp_proxy = IP:PORT

[root@k8s-master ~]# vim /etc/wgetrc 
[root@k8s-master ~]# wget https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
--2020-11-14 02:27:37--  https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml
Connecting to 139.224.67.47:8789... connected.
Proxy request sent, awaiting response... 200 OK
Length: 4813 (4.7K) [text/plain]
Saving to: ‘kube-flannel.yml’

100%[==============================================================================================>] 4,813       --.-K/s   in 0s      

2020-11-14 02:27:37 (37.7 MB/s) - ‘kube-flannel.yml’ saved [4813/4813]

[root@k8s-master ~]# ls
anaconda-ks.cfg  kube-flannel.yml  original-ks.cfg
[root@k8s-master ~]# vim /etc/yum.conf 
[root@k8s-master ~]# 

 

posted @ 2020-11-14 18:36  一切都是当下  阅读(1029)  评论(0编辑  收藏  举报