BlueXIII's Blog

热爱技术,持续学习

0%

ShellClash联网

官网

https://github.com/juewuy/ShellClash/blob/master/README_CN.md

跳板机

ssh root@10.193.36.33

配置

1
2
3
4
5
6
7
8
9
10
11
# 临时开启反向SSH隧道
ssh -R 7890:127.0.0.1:7890 root@10.193.36.33
export https_proxy=http://127.0.0.1:7890 http_proxy=http://127.0.0.1:7890 all_proxy=http://127.0.0.1:7890

# 在线安装ShellClash
export url='https://fastly.jsdelivr.net/gh/juewuy/ShellClash@master' && wget -q --no-check-certificate -O /tmp/install.sh $url/install.sh && bash /tmp/install.sh && source /etc/profile &> /dev/null

# 导入机场订阅

# UI面板
http://10.193.36.33:9999/ui

常规代理

1
export https_proxy=http://10.193.36.33:7890 http_proxy=http://10.193.36.33:7890 all_proxy=http://10.193.36.33:7890

docker配置http代理

1
2
3
4
5
6
7
8
9
10
11
12
# 创建配置文件
mkdir -p /etc/systemd/system/docker.service.d
# 编辑配置文件
cat << EOF >/etc/systemd/system/docker.service.d/http-proxy.conf
[Service]
Environment="HTTP_PROXY=socks5://10.193.36.33:7890/"
Environment="HTTPS_PROXY=socks5://10.193.36.33:7890/"
Environment="NO_PROXY=localhost,127.0.0.1,harbor.dubhe,10.193.36.252"
EOF
# 重启 Docker
systemctl daemon-reload && systemctl restart docker
systemctl show --property=Environment docker

containerd(k3s)配置http代理

https://docs.k3s.io/zh/advanced

1
2
3
4
5
6
7
8
9
10
11
12
13
vi /etc/systemd/system/k3s.service.env        # 在master节点
vi /etc/systemd/system/k3s-agent.service.env # 在agent节点

HTTP_PROXY=socks5://10.193.36.33:7890/
HTTPS_PROXY=socks5://10.193.36.33:7890/
NO_PROXY=127.0.0.0/8,10.0.0.0/8,172.16.0.0/12,192.168.0.0/16,harbor.dubhe,10.193.36.252,10.193.35.11

# 重启k3s,注意要修改并重启每个节点
systemctl restart k3s
systemctl restart k3s-agent

# 查看自动生成的配置
cat /var/lib/rancher/k3s/agent/etc/containerd/config.toml