Google Cloud kubernetes engine external ip

7/5/2018

I have mongodb hosted in Mongo Atlas. There for security reasons I have whitelisted some IPs, that can access it.

Now that I have set up kubernetes cluster in google cloud, how can I make it able to access this mongodb service since I don't have clear IP for my cluster/swarm instances that get spawned on demand.

-- user365314
google-cloud-platform
google-kubernetes-engine
mongodb

1 Answer

7/12/2018

There is no way to get static IPs with GKE. You need to use a NAT gateway. You can configure a GCE VM to act as your NAT gateway for all outbound traffic from your cluster.

There have been multiple requests for a GCP native NAT feature and I believe that feature is on the way. In the meantime, a GCE VM acting as a NAT gateway is your best bet

EDIT you can now use Google Cloud NAT to assign a single (or multiple) static IPs to your cluster (or other Google resources)

-- Patrick W
Source: StackOverflow