参考:https://www.jianshu.com/p/81087da4cbdc
1.安装brew
/bin/zsh -c "$([curl](https://so.csdn.net/so/search?q=curl&spm=1001.2101.3001.7020) -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
选择1
2.安装sshuttle
brew install sshuttle
可能涉及:
xcode-select --install
3.下载并安装KT(以x86 64位版本为例)
$ curl -OL https://github.com/alibaba/kt-connect/releases/download/v0.3.0/ktctl_0.3.0_MacOS_x86_64.tar.gz
$ tar zxf ktctl_0.3.0_MacOS_x86_64.tar.gz
$ mv ktctl /usr/local/bin/ktctl
$ ktctl help
4.安装:kubectl命令
brew install kubernetes-cli
5.将如下config文件拷贝到/.kube/config,该文件是项目dev环境的配置文件(修改配置文件里的IP为服务器IP端口为6443
)
如:server: https://192.168.16.144:6443
https://www.cnblogs.com/S--S/p/10887309.html
https://segmentfault.com/a/1190000018985663
sudo yum install golang
https://blog.csdn.net/orange596/article/details/78698433
https://www.cnblogs.com/netsa/p/8126155.html
-
验证:kubectl get ns
image.png
6.根据官方文档,开启kt
sudo ktctl connect --method=vpn
7.mac设置代理
依次选择:系统偏好设置->网络->高级->代理,设置代理的host和端口,并添加例外:
8.测试 telnet podIp 3306
telnet 10.244.82.129 3306
image.png
网友评论