Set static IP for outcoming request

6/16/2017

I need to access a service from my cluster on GKE outside of it. This service restricts access IP allowing just one IP. So, I have to set a NAT or something like that, but I don't really sure that is the right solution to set an external gateway/NAT on my GKE cluster. Can you help me, please?

-- Giorgio Cerruti
google-cloud-platform
google-kubernetes-engine
kubernetes

2 Answers

6/22/2018

You can use kubeip in order to assign IP addresses blog post

-- avivl
Source: StackOverflow

6/16/2017

You can achieve this by configuring a NAT Gateway.

Here's a guide: https://github.com/johnlabarge/gke-nat-example

The key steps to note are that you'll need to recreate your GKE cluster to apply a network tag to the nodes, and then use that tag in your GCP Route. (You cannot just apply the route to all nodes, as it would then be applied to your NAT Gateway instance(s) as well).

The other point to note (perhaps obviously) is that you cannot route all traffic through the NAT Gateway, unless you route all incoming traffic through it as well. I just it just for outbound traffic to a specific set of IPs which need a stable source.

-- Symmetric
Source: StackOverflow