问题梳理
root@k8s-master01:~# git clone -b v1.29.4 https://github.com/kubernetes/kubernetes.git
Cloning into 'kubernetes'...
fatal: unable to access 'https://github.com/kubernetes/kubernetes.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.
拉取github的项目失败
问题解决
root@k8s-master01:~# vim /etc/environment
# 添加下面内容
http_proxy="http://192.168.139.1:7890"
https_proxy="http://192.168.139.1:7890"
ftp_proxy="http://192.168.139.1:7890"
no_proxy="localhost,127.0.0.1,::1"
####IP为代理地址的IP,7890为代理的端口####你必须得有一个能够可用的科学上网工具
root@k8s-master01:~# source /etc/environment
root@k8s-master01:~# git config --global http.proxy http://192.168.139.1:7890
root@k8s-master01:~# git config --global https.proxy http://192.168.139.1:7890
-
重新拉起代码
root@k8s-master01:~# git clone -b v1.29.4 https://github.com/kubernetes/kubernetes.git
Cloning into 'kubernetes'...
remote: Enumerating objects: 1545595, done.
remote: Counting objects: 100% (86/86), done.
remote: Compressing objects: 100% (76/76), done.
remote: Total 1545595 (delta 29), reused 26 (delta 8), pack-reused 1545509
Receiving objects: 100% (1545595/1545595), 1.01 GiB | 9.30 MiB/s, done.
Resolving deltas: 100% (1131041/1131041), done.
Note: switching to '55019c83b0fd51ef4ced8c29eec2c4847f896e74'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
Turn off this advice by setting config variable advice.detachedHead to false
Updating files: 100% (24911/24911), done.
配置 Docker 代理(如果使用 Docker)
sudo mkdir -p /etc/systemd/system/docker.service.d
vim /etc/systemd/system/docker.service.d/http-proxy.conf
#添加以下内容:
[Service]
Environment="HTTP_PROXY=http://192.168.139.1:7890"
Environment="HTTPS_PROXY=http://192.168.139.1:7890"
systemctl daemon-reload
systemctl restart docker
`验证`
curl -I http://www.google.com
文章评论