The Desi Architect
Notes / Docker Sandboxes / Services and Load Balancing
Docker Sandboxes · Tier 5: Orchestrate: Kubernetes on your laptop · Lab 61

Services and Load Balancing

Decouple client traffic from ephemeral pod IPs using a Kubernetes Service. Inspect dynamic Endpoints as pods scale from 3 to 5 replicas, and measure randomized connection load balancing across the Tatkal API on 127.0.0.1:18301.

Time40 minutes
StackKubernetes v1.37Ports 18301
Memory1.3GB
Before thisLab 60Your First Cluster
Verified runWindows, Mac, LinuxBash and PowerShell
  1. 1PrepareWhat you will learn
  2. 2PredictGuess before you run
  3. 3RunStep by step
  4. 4ObserveWhat you should see
  5. 5Break itChange one thing
  6. 6Clean upLeave nothing running
On this page
  1. 00 / What You Will Learn
  2. 01 / Why It Matters
  3. 02 / What We Are Building
  4. 03 / Words You Need
  5. 04 / Predict First
  6. 05 / Step by Step
  7. 06 / What You Should See
  8. 07 / Look Inside
  9. 08 / Break It, Fix It
  10. 09 / In Real Projects
  11. 10 / Interview Corner
  12. 11 / Clean Up

00 /What You Will Learn

By the end you will be able to
  • Explain why hardcoding pod IP addresses fails in distributed systems.
  • Inspect the separation between a permanent virtual ClusterIP and dynamic Endpoints.
  • Watch the endpoints controller automatically add new pods when scaling from 3 to 5 replicas.
  • Measure how kube-proxy distributes TCP connections across healthy pods via iptables.
  • Identify when to rely on a native Kubernetes Service and when you need a Layer 7 Ingress proxy.

Before you start

Finish Lab 60 (Your First Cluster) first. You should know how to create a kind cluster and deploy a basic pod manifest. Give Docker at least 4 GB of memory, and make sure kind and kubectl are installed.