Home > Software engineering >  K8S | Why Service of type LoadBalancer is only supported on cloud platforms?
K8S | Why Service of type LoadBalancer is only supported on cloud platforms?

Time:10-03

I think I'm having trouble understanding a couple of concepts related to Services in K8S. I'd appreciate your help. My questions are:

  • In docs it's written that a Service of type LoadBalancer is only supported on cloud platforms, but I couldn't find a place where it's explained why. Is it due to some limitations of other setups or the fact the K8S just doesn't ship their own implementation (so they have to rely on cloud providers) or something else?
  • Below you can see a picture that explains my current understanding of Service NodePort (took from one article), i.e. requests to a specific Node are routed to one ClusterIp service and it load balances among ALL cluster pods (i.e. all pods throughout all nodes). The docs also say that LoadBalancer is built upon NodePort. Which means, that in the end the load balancing is performed by ClusterIp among all cluster Pods. So what kind of load balancing does LoadBalancer perform? Does it have a way to tell ClusterIp that pods only from one Node should be selected or maybe LoadBalancer takes over the whole load balancing among the Pods?

scheme

CodePudding user response:

Actually loadbalancer is also supported by default in k3s (kalipper). You can use MetalLB or PureLB as well.

Even minikube has a loadbalancer implementation.

  • Related