Container and Kubernetes load balancing
medium 30 minContainers come and go and their addresses change.
Where it shows up
The same pattern appears across everyday software.
One entrance for thirty services
A company replaces thirty LoadBalancer Services by one Gateway with thirty routes. One external balancer is paid for instead of thirty, and certificates live in one place.
Deployment at noon without errors
Each deployment caused a few refused connections. A pause of 10 seconds before stopping and a grace period of 40 removed them.
The idle new pods
A gRPC service scaled from 3 to 9 pods and nothing got faster: callers kept their old connections. A headless Service with client balancing spread the load.
A database with a headless Service
Each replica has its own DNS name. Clients can ask for the primary directly, which a Service with one shared address could not offer.
Allow list for a partner
A partner needs to see client addresses. The team sets the traffic policy to Local and spreads pods evenly over nodes so that the load stays fair.
Mesh in a bank
Every call between services must be encrypted and recorded. A mesh does this in one place for services in five languages.