我已经部署了Google cloud Kubernetes集群。群集仅有内部IP。
为了访问它,我创建了一个具有外部IP的虚拟机bastion-1。
结构:
My Machine -> bastion-1 -> Kubernetes cluster与代理工作站的连接:
$ ssh bastion -D 1080现在使用代理使用kubectl:
$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl get pods
No resources found.Kubernetes主服务器正在响应,这是一个好兆头。
现在,尝试ssh一个pod:
$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl exec -it "my-pod" -- /bin/bash
error: error sending request: Post https://xxx.xxx.xxx.xxx/api/v1/namespaces/xxx/pods/pod-xxx/exec?command=%2Fbin%2Fbash&container=xxx&container=xxx&stdin=true&stdout=true&tty=true: EOF问:如何通过堡垒连接ssh到pod?我哪里做错了?
发布于 2019-02-06 16:08:25
https://stackoverflow.com/questions/54548736
复制相似问题