Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set the external IP of a specific node in Google Kubernetes Engine?

Unfortunately, we have to interface with a third-party service which instead of implementing authentication, relies on the request IP to determine if a client is authorized or not.

This is problematic because nodes are started and destroyed by Kubernetes and each time the external IP changes. Is there a way to make sure the external IP is chosen among a fixed set of IPs? That way we could communicate those IPs to the third party and they would be authorized to perform requests. I only found a way to fix the service IP, but that does not change at all the single nodes' IPs.

To be clear, we are using Google's Kubernetes Engine, so a custom solution for that environment would work too.

like image 595
rubik Avatar asked Jan 01 '23 18:01

rubik


1 Answers

Yes, it's possible by using KubeIP.

You can create a pool of shareable IP addresses, and use KubeIP to automatically attach IP address from the pool to the Kubernetes node.

IP addresses can be created by:

  1. opening Google Cloud Dashboard
  2. going VPC Network -> External IP addresses
  3. clicking on "Reserve Static Address" and following the wizard (on the Network Service Tier, I think it needs to be a "Premium", for this to work).
like image 101
Pedro Rodrigues Avatar answered Jan 04 '23 02:01

Pedro Rodrigues