Home > Software design >  "Sharing" static IP in Kubernetes nodes
"Sharing" static IP in Kubernetes nodes

Time:10-24

Our specialized provider exposes an API that allows only one consumer IP.

How can we get the requests of a cluster with three nodes go out from the same public IP (without NGinX proxy)?

CodePudding user response:

How can we get the requests of a cluster with three nodes go out from the same public IP

Assign the IP to a node, thus making it public. Use an Ingress controller (built-in or third-party) to map internal services to different ports on the node with the public IP.

without NGinX proxy

You are going to need a reverse proxy either way. Making all worker nodes public should be avoided in general. Regardless, since your provider forces one IP per consumer, you have no other option but to use a reverse proxy. Ingress Controllers are reverse proxies that generate their routing configuration using Kubernetes Ingress objects.

CodePudding user response:

How can we get the requests of a cluster with three nodes go out from the same public IP (without NGinX proxy)?

Since this question is being tagged as Google Cloud Platform, I am assuming that you are using it.

The way I would do this is to put those three nodes behind Cloud NAT, and assign a static IP address to the Cloud NAT.

Here is some information on how to do that: https://cloud.google.com/nat/docs/using-nat

Specifically, the section Specify IP addresses for NAT.

You can then inform your specialized provider to whitelist the IP address that you assign to your Cloud NAT.

  • Related