使用KubeAdm部署Kubernetes集群——如何访问google代码仓库及Yum源

时间:2021-07-03 05:16:43

一、申请国外服务器,部署*服务

1、下载并创建配置文件

wget https://github.com/*/*-go/releases/download/1.2.1/*-server.tar.gz
tar -zxf *-server.tar.gz
cd *-server
cat > config.json <<EOF
{
    "server":"127.0.0.1",
    ,
    ,
    "local_address":"127.0.0.1",
    "password":"yourpassword",
    "method": "aes-256-cfb",

}
EOF

2、打开防火墙对应端口

systemctl status firewalld
firewall-cmd --permanent --zone=public --add-port=/tcp
firewall-cmd --permanent --zone=public --add-port=/udp
firewall-cmd --reload

3、设置自启动

cat > /lib/systemd/system/*.service <<EOF
[Unit]
Description=*Server
After=network.target

[Service]
ExecStart=/*-server/*-server -c /*/config.json  >>*-`date +%Y-%m`.log &
ExecStop= `ps -au | grep -v grep |grep *-server | awk '{print $2}'`  >>*-`date +%Y-%m`.log

[Install]
WantedBy=multi-user.target
EOF

systemctl start *
systemctl enable *

二、安装客户端

yum install python-pip
pip install *
pip install --upgrade pip
pip install *
cat > /etc/*.json  <<EOF
{
"server":"yourserver",
,
"local_address":"127.0.0.1",
,
"password":"yourpassword",
,
"method":"aes-256-cfb",
"fast_open": false
}
EOF

sslocal -c /etc/*.json -d start
#sslocal -c /etc/*.json -d stop

三、安装socket5转http代理工具

yum install privoxy
 . >> /etc/privoxy/config
systemctl restart privoxy

四、启用或停用全局http/https代理

export http_proxy=http://localhost:8118
export https_proxy=https://localhost:8118

#unset http_proxy
#unset https_proxy

五、使用更灵活的代理方式

yum -y install gcc
wget http://ftp.barfooze.de/pub/sabotage/tarballs/proxychains-ng-4.13.tar.xz
tar -xvf proxychains-ng-4.13.tar.xz
cd proxychains-ng-4.13
./configure
make && make install
cp ./src/proxychains.conf /etc/proxychains.conf
vi /etc/proxychains.conf
#将socks4 

用法:在需要代理的命令前加上 proxychains4 ,如:proxychains4 curl www.google.com