<p>In a container running with host networking option it is possible to use a host network interface and its IP from the container and contact external network <em>from</em> this interface and IP. So if a host has several IPs configured, the container can choose which one it uses.</p>

<p>Can I have a similar setup with Kubernetes and let a container use an host IP ?</p>

<p>NB: I need the process to contact an external service <em>from</em> specific IPs, I dont necessarily need those IPs to be assigned to a container from an external view.</p>

Stéphane Busso
<p>As I wrote in <a href="https://stackoverflow.com/questions/51943950/egress-ip-adress-selection/51944171">Egress IP adress selection</a> :</p>

<blockquote>
  <p>One of the things that could help you solve it is Istio Egress Gateway so I suggest you look into it.</p>
  
  <p>Otherwise, it is still dependent on particular platform and way to deploy your cluster. For example on AWS you can make sure your egress traffic always leaves from predefined, known set of IPs by using instances with Elastic IPs assigned to forward your traffic (be it regular EC2s or AWS NAT Gateways). Even with Egress above, you need some way to define a fixed IP for this, so AWS ElasticIP (or equivalent) is a must.</p>
</blockquote>
