LoadBalancer. When you create a LoadBalancer Service in your tenant cluster, KubeLB CCM automatically propagates it to the KubeLB management cluster, which provisions the external load balancer.
How It Works
The Layer 4 load balancing flow works as follows:- Service Creation: You create a Service with
type: LoadBalancerin your tenant cluster - CCM Propagation: KubeLB CCM watches the Service and creates a corresponding
LoadBalancerCRD in the management cluster - Load Balancer Provisioning: KubeLB Manager provisions the load balancer and assigns an external IP
- Status Sync: The external IP is synced back to the Service status in your tenant cluster
- Traffic Routing: Traffic flows through the load balancer to your cluster nodes via NodePort
KubeLB uses NodePort services internally to route traffic from the management cluster to your tenant cluster.
Creating a Basic LoadBalancer Service
Using LoadBalancer Class
If your cluster has multiple load balancer implementations, specify the KubeLB class:Multi-Port Services
KubeLB supports services with multiple ports:UDP Services
KubeLB supports UDP protocol for services like DNS or game servers:External Traffic Policy
Control how external traffic is routed to your pods:- Cluster (Default)
- Local
Traffic is distributed across all nodes in the cluster:Pros:
- Better load distribution
- Works with any number of nodes
- Client source IP is obscured
- Additional network hop possible
Understanding the LoadBalancer CRD
When you create a LoadBalancer Service, KubeLB creates a corresponding CRD in the management cluster:Key Fields
- metadata.name: Set to the Service UID for uniqueness
- metadata.labels: Tracks the original Service name and namespace
- spec.endpoints: References the Addresses resource containing node IPs/endpoints
- spec.ports: The ports exposed by the load balancer
- status.loadBalancer: Contains the assigned external IP
Verifying Load Balancer Status
From your tenant cluster:Cleanup
Deleting the Service automatically cleans up the LoadBalancer CRD:Troubleshooting
Service stuck without external IP
Service stuck without external IP
Check CCM logs:Check LoadBalancer CRD in management cluster:Common causes:
- CCM not running or misconfigured
- Network connectivity issues between clusters
- LoadBalancer class mismatch
Cannot reach service via external IP
Cannot reach service via external IP
Verify the external IP is assigned:Test from within the cluster:Check node endpoints:
- Ensure nodes are accessible from the management cluster
- Verify NodePort service is created
LoadBalancer CRD not created
LoadBalancer CRD not created
Check if service should be reconciled:Look for flags:
- Verify
type: LoadBalancer - Check if
loadBalancerClassis set correctly (if required)
--use-loadbalancer-class--cluster-name
Next Steps
- Learn about Layer 7 HTTP/gRPC routing
- Configure multi-cluster management
- Set up DNS automation
