Load balance pods with Nginx ingress

4/5/2019

How to balance requests between each pod using proxy-next-upstream setting on Nginx ingress. Nginx ingress should try all pods available before returning an error to client.

If I understand correctly ingress is going to load balance between services not pods. So if there is one service proxy-next-upstream is useless? Should I create separate service for each pod or there are better solutions?

-- Jonas
kubernetes
nginx-ingress

1 Answer

4/5/2019

The ingress in your case will have a service type object as backend. The service itself then has multiple pods as backends to it. This way in a micro service architecture one ingress can have multiple services as backends for example for multiple different URL contexts that are served by different applications.

You can read all about the different kind of services that exist here

-- Rick Rackow
Source: StackOverflow