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
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.
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With