Open ashu210890 opened 6 years ago
That usually happens when the static route to the master IPs has not been created. The example creates this route to preserve behavior like kubectl exec and logs.
@danisla are you using a regional cluster? If so, I wasn't able to get this to work when using the endpoint IP as the gke_master_ip. I instead had to a semicolon-delimited list of the zonal master IPs, which I found by looking at the filter list for firewall rule 'gke-
I used the terraform NAT example to setup a NAT gateway for all egress from my GKE cluster. I tried the following ssh command that was given in the readme and it works:
gcloud compute ssh $(gcloud compute instances list --filter=name~nat-gateway-${REGION} --uri) --ssh-flag="-A" -- ssh $(gcloud compute instances list --filter=name~gke-${CLUSTER_NAME}- --limit=1 --format='value(name)') -o StrictHostKeyChecking=no
However, when In try to access the pods using
kubectl exec
orkubectl attach
orkubectl logs
, I get the following error:I already checked that the ssh forward firewall rule from GKE cluster master IP to to the nodes exists and seems correct. What am I doing wrong here?