We have a microservice application, which uses paid software to do some specific operations. This software uses online license verification to function properly.
As customer Kubernetes cluster is in the VPC, which doesn't have access to the internet, this online license verification is impossible without forwarding it to the proxy machine, which can reach license server domain.
The license server is located on specific domain, therefore this traffic must be routed from the container of the microservice to a proxy machine.
Only this proxy machine has access to the internet and should forward this traffic to the license server of the software vendor.
In the VM world it could be done like this:
sysctl net.ipv4.ip_forward=1
iptables -t nat -A PREROUTING -p tcp --dport port -j DNAT --to-destination ip:port
iptables -t nat -A POSTROUTING -j MASQUERADE
However what's the recommended way to do it in a Kubernetes cluster.
Here is a simple diagram of the desired communication between all services:
UPDATE: Unfortunately URL of the external license server is hardcoded into the paid library and can't be overwritten.