GCP:通过代理在私有集群上运行 kubectl exec

Ere*_*ush 5 proxy bastion google-kubernetes-engine

我有一个带有私有 IP 的私有 kubernetes 集群。为了访问它,我设置了一个带有鱿鱼代理的堡垒主机。它看起来像这样:

My host -> bastion -> private cloud
Run Code Online (Sandbox Code Playgroud)

常规 kubectl 命令可以按预期抛出代理:

$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl get pods 
No resources found.
Run Code Online (Sandbox Code Playgroud)

问题是当尝试 ssh 到 pod 时:

$ HTTPS_PROXY=socks5://127.0.0.1:1080 kubectl exec -it "some-pod" -- /bin/bash
error: error sending request: Post https://<master-ip>/api/v1/namespaces/ns/pods/some-pod/exec?command=%2Fbin%2Fbash&container=xxx&container=xxx&stdin=true&stdout=true&tty=true: EOF
Run Code Online (Sandbox Code Playgroud)

我究竟做错了什么?

小智 2

正如另一篇Stackdriver 帖子中所述,EXEC 命令使用SPDY2,因此无法实现。

这篇GitHub 帖子中有更多详细信息