自學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 ~]# 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM