Shortly, there are two services that communicates with each others via HTTP REST APIs. My deployment is running in an AKS cluster. For ingress controller, I installed this Nginx controller helm chart:
https://kubernetes.github.io/ingress-nginx
The load balancer has a fix IP attached. My deployment running in my cluster should send usage info to the other service periodically and vica versa. However, that service has an IP whitelist and I need to provide a static IP for whitelisting my deployment. Currently, the problem is that my cURL call has the node’s IP which is always changing depending on which node my deployment is running on. Also, the number of nodes are scaled dinamically, too. My goal is to send egress traffic through the loadbalancer something like this:
Is there any way to route the outbound traffic from my pods to the loadbalancer?
2
Answers
This is possible with Azure Load Balancer with outbound rules; which the LB will do a SNAT and your "other service" will see the fixed frontend public IP. Another method is use Virtual Network NAT where your "other service" will see the fixed NAT public IP. You can then whitelist the fixed public IP either way.
I guess you could use the following link to update the load balancer to use the static egress/outbound IP address.
https://learn.microsoft.com/en-us/azure/aks/load-balancer-standard