google-cloud-platformgoogle-kubernetes-enginefirewallgke-networking

GKE node pool tags and firewall rules


I have a GCP project with:

I would like to create a firewall rules that would allow pods in the GKE cluster to connect to the VM, so I have created the following firewall rule:

But it does not work.

Instead if I set the source range to the pods cidr (172.16.0.0/18) it works.

Any suggestions?


Solution

  • That's because you are using a VPC Native Cluster. VPC Native clusters are the default mode and they made the Pod IP's visible in the VPC. This means when a pod talks to a destination which is on VPC, the IP of the Pod is NOT Source Nated behind the Node IP.

    You have two options: