Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

GKE unable to connect to the server: dial tcp server_ip: i/o timeout

Every time I run a command in the kubernetes cluster I get the following error message: unable to connect to the server: dial tcp server_ip: i/o timeout

I've already followed the step by step to try to solve the problem described here: https://cloud.google.com/kubernetes-engine/docs/troubleshooting#kubectl-times-out, but it didn't solve the problem

Has anyone had this problem?

0 4 1,036
4 REPLIES 4

Hello,

Is this a private Cluster? And from where you are connecting to the Cluster? Cloud Shell or local PC?

Please provide more information on how you are connecting to Cluster.

yes, it's a private cluster, in fact the connection is experiencing a problem in a github actions pipeline, the connection to the cluster is made like this: https://cloud.google.com/kubernetes-engine/docs/tutorials/private-cluster-bastion#connect

Do you have a FW rules permitting access to the proxy IP:Port?

yes, the firewall rules are configured.

Something I realized today is that when I make a direct ssh connection to the bastion vm in the compute engine, the commands are returning correctly, but when I execute the commands via gcloud or via pipeline, they are returning timeouts.

the command I'm running to deploy via pipeline is like this: gcloud compute ssh ${GKE_CLUSTER}-bastion --zone ${GKE_ZONE} --project ${PROJECT_ID} --tunnel-through-iap --ssh-key-expire-after=7m --command=“sleep 15” -- -L8888:127.0.0.1:8888 &
sleep 10 && HTTPS_PROXY=localhost:8888 kubectl apply -f dist/*.yaml --context=${ secrets.CLUSTER_CONTEXT_PROD }}

Top Labels in this Space
Top Solution Authors