Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

metalLB vs ingress vs (nodeport or cluster ip) in kubernetes

Tags:

kubernetes

I want to deploy kubernetes in a non-cloud environment.

I know MetalLB is an L2 load balancer and ingress is an L7 load balancer and nodeport can load balance in L4, but the question is in production (expecting 1 million requests) how should I use them?

Is it necessary to have all of them?

nodeport can load balance between pods that are on different nodes so it seems that using MetalLB that also load balances between nodes is useless. How can you explain it?

Thanks

like image 785
yasin lachini Avatar asked Mar 20 '19 14:03

yasin lachini


People also ask

What is the difference between NodePort and cluster IP?

The NodePort type is an extension of the ClusterIP type. So a Service of type NodePort has a cluster IP address. The LoadBalancer type is an extension of the NodePort type. So a Service of type LoadBalancer has a cluster IP address and one or more nodePort values.

What is NodePort and cluster IP in Kubernetes?

ClusterIP (default): Internal clients send requests to a stable internal IP address. NodePort: Clients send requests to the IP address of a node on one or more nodePort values that are specified by the Service. LoadBalancer: Clients send requests to the IP address of a network load balancer.

What is ingress IP in Kubernetes?

Kubernetes Ingress is an API object that provides routing rules to manage external users' access to the services in a Kubernetes cluster, typically via HTTPS/HTTP. With Ingress, you can easily set up rules for routing traffic without creating a bunch of Load Balancers or exposing each service on the node.

Do I need ingress with MetalLB?

Requirements for MetalLBMost applications are created with a LoadBalancer service or require an ingress controller/service mesh to receive traffic. With a built in LoadBalancer that can map external IP addresses directly to your cluster, you can replicate a cloud provider.


1 Answers

Are you deploing it on premises? I would use all of them in production, and use metallb in mode BGP, where it divides the on going traffic among the nodes. Metallb divides the traffic between the physical nodes, Ingress finds the appropriate service, and NodePort find the pod in the cluster. They are all necessary for best practices. If you are on cloud providers go for a LB launched there. It can scale accordingly to demand.

like image 178
Leandro Donizetti Soares Avatar answered Sep 25 '22 03:09

Leandro Donizetti Soares