I'm running in a GKE cluster (1.15.12-gke.2) some applications that need to connect to a third-party API. This third-party API has mandatory IP filtering. So in order to get API authorized, I need to declare what are the public IP that I'll use to connect to the API.
My problem is that public IPs of GKE nodes are not stable across upgrade and it would prevent the use of node autoscaling & after every time of nodes restart IP will change
Is there any way to have a stable outbound public IP on GKE?
Thanks
-Ashok Patidar
Best Answer
As I said in my comment, the solution to have a static outbound IP in
GKE
is to useCloud NAT
.You can read more about private
GKE
clusters by following official documentation:There is also an official guide showing the process of creating a private
GKE
cluster and then connecting it withCloud NAT
:I ran a test where I spawned private
GKE
cluster with 3 nodes. Created pods that each one of them was scheduled on a different node. Every pod sent a packet to a remote server. Listening on remote server showed that every pod that sent a message had the same source IP: