Just deployed my new Kubernetes cluster to Google Cloud. It's a private cluster - available only from the internal network. I connecting this cluster from bastion
machine. With my bastion
host, I can manage my cluster.
My cluster configuration:
It's seems like my pods doent have network to go out of the pod. for example:
$ curl google.com
Return error - unable to connect. So I logged the pod with SSH and tried to figure out what is the problem.
Two options that I can think of:
Firewall blocks all the egress traffic by default? I tried to allow it with new firewall rule that allow egress. It's didn't solved the problem. (where 10.56.0.0/14
is my pods range)
My network dont have "default gateway" that allow internet access. I checked in "routers" area and it seems like it there:
How to solved the issue and let my pods access to the internet freely?
Found the missing part.
In the Kubernetes Engine Private Cluster model, your nodes have access to the rest of your VPC private deployments, including private access to Google managed services such as gcr.io, Google Cloud Storage and Google BigQuery. Access to the internet isn’t possible unless you set up additional mechanisms such as a NAT gateway.
Adding NAT solved the issue!