Load balancing in Kubernetes is used to optimally balance the load distribution emanating out of the networking traffic from external sources. Load balancing is accomplished through a feature called kube-proxy, which manages the virtual IPs used by services. To access deployments in the Kubernetes cluster from the external network, we must set up a load-balancer. In this setup, we are using MetalLB as a load-balancer.
#kubectl apply -f https://raw.githubusercontent.com/google/metallb/v0.8.3/manifests/metallb.yaml
This command deploys MetalLB in the Kubernetes cluster, under the metallb-system namespace.
- name: default
#kubectl create -f metallb-config.yaml