question

TaB-8489 avatar image
0 Votes"
TaB-8489 asked TaB-8489 commented

Is ingress-nginx really a load balancer or not?

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-serviceazure-load-balancer
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@prmanhas-MSFT , Hey preeti. Hwz going. All well at your end?

Could you please help us as whole theory is getting confused here. I always heard the nginx term along with load balancers. The pointer I've shared above has definitely impacted the current mindset.

I would be grateful if you can help on this. Thank you. Take care.

0 Votes 0 ·

1 Answer

prmanhas-MSFT avatar image
2 Votes"
prmanhas-MSFT answered TaB-8489 commented

@TaB-8489 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.








· 4
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

@TaB-8489 Any update on the issue?

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





0 Votes 0 ·

@prmanhas-MSFT , Hey preeti, Sorry for replying late got stuck in a production issue. Some c++ dll's disturbing the project because machine was not having its drivers.

Thanks a lot for the such a detailed answer. You are a true hero.

But need to highlight this link and details under this heading: Load balancing configuration via the Ingress resource. The details are very less on how ingress-nginx can act as a load balancer.

One more thing need to ask, is azure load balancer able to handle gRPC calls as you've said envoy is not needed. Because, as far as I know azure app services doesn't support. Not sure for load balancer on HTTP/2 or grpc support.



0 Votes 0 ·

@TaB-8489 As mentioned earlier Ingress is not Load Balancer but can help you out with some load balancing you can say more around redirecting traffic but definitely not like a full fledged load balancer.

As mentioned here An L4 load balancer accepts a TCP connection request from a client, opens another connection to one of the back-end instances, and copies data between the two connections with no real processing. L4 offers excellent performance and low latency, but with little control or intelligence. As long as the client keeps the connection open, all requests will be directed to the same back-end instance.

Azure Load Balancer is an example of an L4 load balancer. L4 load balancers will work with gRPC applications, but they're primarily useful when low latency and low overhead are important.

Hope it helps!!!


1 Vote 1 ·
Show more comments