-2

I have an application running in a POD on kubernetes. This application connects to server external Public IP address and expects the clients to have specific public IP address. The server checks the source IP address for security.

Now that my application is running inside k8s cluster it will have some local IP address.

How to fix this ... is there a way to do NAT on source IP address based in the destination server address ? If so how to do this ?

Chandu
  • 1,837
  • 7
  • 30
  • 51
  • If I understand correctly you are asking how to bypass your own security mechanism. If you'll receive an answer, what will it say about your security? :-) – BartoszKP May 13 '19 at 14:52

1 Answers1

2

Kubernetes uses worker nodes Internet connection. You can setup NAT for your nodes and the Kubernetes will use NAT's public IP. You can further attach multiple public IPs to NAT node and write iptables or iproute rules which can make NAT or routing decisions based on destination IP address.

Vasili Angapov
  • 8,061
  • 15
  • 31
  • Thanks Vasily, So you mean to say that I have to write iptables and install them in all the nodes. Any working example or reference available ? – Chandu May 14 '19 at 05:03
  • @Chandu Please consider posting another question with a concrete scenario and YAMLs that define it in a way allowing anyone to reproduce the environment. This way people will be more likely to give you examples back, not just produce code to satisfy your order ;) – BartoszKP May 14 '19 at 09:59