简体   繁体   中英

Kubernetes route internal trafic to my loadbalancer (one public ip)

I'm using OVH cloud and K8S (with ingress/loadbalancer/nginx)

How can I route all my node traffic (my containers) to ingress (Loadbalancer)? Actually I got one Public IP by Node, (and they change every time I setup/delete node)

The Goal : have always same public IP when I request external API, I need trust my IP to this external API (by white list)

I looked about Egress but is look it's not work.

Have you some example or tips for me?

You can proxy container or proxy DNS option with each running pod which will pass the traffic to specific DNS pod and that will manage your traffic from one single Node.

However it's not scalable solution.

If you are using the istio also thn also you have to create the Egress gateway POD fix on a single node with affinity . So each time you will get the same IP if the container restart or so and get back scheduled to same node.

https://istio.io/latest/docs/tasks/traffic-management/egress/egress-gateway/

Another solution is to use the NAT gateway i have not setup with OVH cloud however it's scalable solution if you Node are in public su.net.

Here is nice GKE project we been using to create single point of egress for our K8s clusters: https://github.com/GoogleCloudPlatform/terraform-google-nat-gateway/tree/v1.2.3/examples/gke-nat-gateway

You can also implement same with OVH cloud if you can using the NAT gateway.

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