Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use cloud NAT in public GKE cluster pods using sourceIP

As per GCP documentation on Cloud NAT,

Regular (non-private) GKE clusters assign each node an external IP address, so such clusters cannot use Cloud NAT to send packets from the node's primary interface. Pods can still use Cloud NAT if they send packets with source IP addresses set to the pod IP

Question: How do I configure pods to set source IP to pod IP while sending packets to some external service?

like image 537
Saras Avatar asked Feb 05 '19 12:02

Saras


1 Answers

Cloud NAT is used to permit GCE instances or GKE clusters that only have internal IP addresses to access public resources on the internet. If you want to use Cloud NAT, you will need to follow the guidelines from the public docs or you can build your own NAT gateway using a GCE Instance which does not require you to use a private cluster.

like image 198
Muhammad Ebaduddin Avatar answered Oct 18 '22 13:10

Muhammad Ebaduddin