Giorgio Cerruti
Giorgio Cerruti

Reputation: 896

Set static IP for outcoming request

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?

Upvotes: 3

Views: 1413

Answers (2)

avivl
avivl

Reputation: 401

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

Upvotes: 1

Symmetric
Symmetric

Reputation: 4723

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.

Upvotes: 1

Related Questions