yellowhat
yellowhat

Reputation: 539

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?

Upvotes: 2

Views: 1763

Answers (1)

boredabdel
boredabdel

Reputation: 2140

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:

  • Use the Pod CIDR in your firewall rule as you mentionned.
  • Use the IP masq Agent to hide the Pod IP's behind the Node IP's.

Upvotes: 3

Related Questions