Does kubernetes have it's own Load Balancer?

6/14/2019

Do Kubernetes has it's own Load Balancer?

I read about LoadBalancer Service while deployment to expose it outside cluster, but it uses my cloud provider Load Balancer.

Kubernetes doesn't have it's own Load Balancer like Nginx had?

I also read External and internal Load Balancer. Does they talking about Cloud service provider Load Balancer?

-- Dhanraj
kubernetes

3 Answers

6/15/2019

Ingress is a solution available since kubernetes 1.1 that allows inbound connections to the cluster.

It's an alternative to the external LoadBalancers(i.e your cloud service provider load balancer) and nodePort

Ingress allows you to easily expose services that need to be accessible from outside the cluster

With Ingress you can run your own ingress controller(basically a loadbalancer) within kubernetes cluster.

There are default ingress controllers available or you can write your own ingress controller.

--
Source: StackOverflow

6/14/2019

According to ServiceTypes

LoadBalancer: Exposes the service externally using a cloud provider’s load balancer. NodePort and ClusterIP services, to which the external load balancer will route, are automatically created.

So If you want something similar to Nginx proxy routing, you should check Ingress resource. It could help you.

The main principle: You have one LoadBalancer or NodePort Service for Ingress Controller that provisioned by cloud provider and multiple route rules through Ingress resources.

Presentation about Networking and Nginx Ingress Controller

Networking in k8s

-- SKorolchuk
Source: StackOverflow

6/14/2019

Note that if you deploy a Kubernetes service with type LoadBalancer, it deploys a L4 internal load balancer. It doesnt offer all those capabilities that you get with external load balancer.

most of the external load balancers these days handles Layer 7 in terms of http headers and content based routing etc.

you can look at ingress controller for advanced load balancer features on par with external load balancer. But you need to front it with external load balancer for HA

-- P Ekambaram
Source: StackOverflow