Is ingress-nginx really a load balancer or not?

Tanul 1,281 Reputation points
2021-03-02T14:59:23.79+00:00

Team,

Today, I was discussing with my senior officials on managing the grpc services in AKS cluster and what kubernetes.io suggest is to use ingress-nginx for load balancing of Http 1.1 and use service mesh like linkerd along with that for grpc stuff.

But, one person pointed out that ingress-nginx is not a load balancer. Either we use path based or host based routing and it always reaches to a specific cluster ip behind which load balancing occurs. So in reality nothing like load balancing is possible with ingress controller.

Is it really true because till date I always heard the term nginx next to any load balancer. Because, If it is acting just as a proxy then for any service(especially for gRPC) we can easily replace ingress-nginx and any service mesh with envoy.

It not only covers the load balancing but grpc support as well.

Please let me know your thoughts. Thank you.

Regards,
Tanul

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,144 questions
Azure Load Balancer
Azure Load Balancer
An Azure service that delivers high availability and network performance to applications.
450 questions
{count} votes

Accepted answer
  1. prmanhas-MSFT 17,906 Reputation points Microsoft Employee
    2021-03-02T17:01:47.54+00:00

    @Tanul Thank you for reaching out. All good at my end and I hope same is on your end as well :)

    Coming to your query Ingress-nginx is not a load balancer but on a broader lever can help you with load balancing.

    But there are two things-

    1) ingress controller - which is a traffic management solution I would say. Yes it manages the traffic using path based or host based routing. yes it goes to a cluster IP at the backend which again does a load balancing among different pods.
    2) ingress- rules written to define how the traffic is to be managed. basically, it tells nginx ingress controller to send traffic to which IP at the backend.

    As mentioned here as well:

    When you create a LoadBalancer type Service, an underlying Azure load balancer resource is created. The load balancer is configured to distribute traffic to the pods in your Service on a given port. The LoadBalancer only works at layer 4 - the Service is unaware of the actual applications, and can't make any additional routing considerations.
    Ingress controllers work at layer 7, and can use more intelligent rules to distribute application traffic. A common use of an Ingress controller is to route HTTP traffic to different applications based on the inbound URL.

    You can refer to this as well for more information.

    Either we use path based or host based routing and it always reaches to a specific cluster ip behind which load balancing occurs.

    Yes the above statement is correct.

    Because, If it is acting just as a proxy then for any service(especially for gRPC) we can easily replace ingress-nginx and any service mesh with envoy.

    Yes you don't need to have ingress controller in everything to handle GRPC calls but rather than going for envoy you can make use of Azure Load Balancer which is by default created at time of AKS creation and will save you the trouble of implementing envoy.

    You can read more about it here.

    More info here as well:

    https://github.com/kubernetes/ingress-nginx

    https://kubernetes.io/docs/concepts/services-networking/ingress/

    Hope it helps!!!

    Please "Accept as Answer" if it helped so it can help others in community looking for help on similar topics.

    2 people found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.