K8s by Example: Services (LoadBalancer)
| LoadBalancer provisions an external load balancer from your cloud provider (AWS ELB, GCP LB, Azure LB). Traffic is routed to your Pods. Only works in supported environments. |
| service-loadbalancer.yaml | |
| Set | |
| terminal | |
| The external IP appears in the Service status once provisioned. This can take a few minutes depending on the cloud provider. | |
| service-lb-aws.yaml | |
| Cloud-specific annotations configure the load balancer. Each provider has different options for internal LBs, NLB vs ALB, etc. | |
| terminal | |
| Each LoadBalancer Service creates a separate cloud resource (deleted when Service is deleted). For multiple services, use Ingress to share a single load balancer. | |