我要库贝克尔使用不同的本地港口,而不是22个。这个可以配置吗?这是我必须在ssh中配置的东西吗?
我想先用IAP创建一个ssh隧道,并让kubeclt使用它连接到私有集群。
I create the tunnel like this:
gcloud compute start-iap-tunnel --project "myproject" \
"nodex-default-pool-abc123-1xc8" 22 --local-host-port=localhost:2200现在我希望kubectl使用它通过本地端口2200进行连接。
我想避免有一个堡垒vm,而只是利用IAP。
我试图设置HTTPS_PROXY,但似乎无法工作:
HTTPS_PROXY=localhost:2200 kubectl get pods
Unable to connect to the server: malformed HTTP response "SSH-2.0-OpenSSH_8.5"编辑:我还试图打开一个通往控制平面的隧道,但看起来GKE不支持IAP进行身份验证?
PROJECT_ID=myproject
ZONE=us-central1-b
REGION=us-central1
NETWORK=mynetwork
MASTER_IP=$(gcloud container clusters describe mycluster --zone $ZONE --project $PROJECT_ID --format=json | jq .endpoint -r)
gcloud alpha compute start-iap-tunnel $MASTER_IP 443 --project $PROJECT_ID --network=$NETWORK --region=$REGION \
--local-host-port=localhost:4444
Testing if tunnel connection works.
ERROR: (gcloud.alpha.compute.start-iap-tunnel) While checking if a connection can be made: Error while connecting [4033: 'not authorized'].也许IAP需要一个DNS名称来启动google或者什么的?我还尝试只连接到集群名称本身,但这返回了一个连接错误。
发布于 2022-09-07 14:39:30
有一个文章与您对使用IAP连接到私有集群的关注有关。在其中,他们解释说,有可能进行下去。在所附文章中,在客户端计算机上提供命令之前满足了一些先决条件。
https://serverfault.com/questions/1110128
复制相似问题