简体   繁体   中英

Kubernetes service makes outbound connections - how to make it originate from a virtual ip

I currently have a Kubernetes cluster, and we have a service that needs to be accessible from a virtual ip.

This in itself is not a difficult process - can use keepalived and nodeports. However, I need that service when its making outbound connections to be bound to that virtual ip (this is due to a legacy system we interact with).

Is there anything in place or that I can use that will help me with this in a generic way.

I essentially want traffic from a specific service to come out of the virtual ip and not the kubernetes host's ip.

You can use hostNetwork: true for your deployment, this will start your pods outside of NAT, and you will be able to see all the system interfaces.

Keep in mind that nodePort won't be available when hostNetwork is enabled.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM