← Back to Projects
⛵

Kubernetes Journey: From Pods to Public LoadBalancers on AKS

Pods → ReplicaSets → Deployments → HPA → Health Probes → Services → Public IP on Azure Kubernetes Service

PlatformAzure Kubernetes Service (AKS)
Toolskubectl · AKS · HPA · Metrics Server · Nginx
TypeContainer Orchestration Learning Journey
Read on MediumView Article →

The Learning Path

Every Stage of the Journey

🌱

Pods — The Atomic Unit

Started with kubectl run nginx. It felt small — almost trivial. But pods taught me that every containerized application needs a home, and pods are that home. The smallest deployable unit in Kubernetes, containing one or more containers that share network and storage.

🔄

ReplicaSets — Self-Healing in Action

Deleted a pod just to see what would happen. Within seconds, Kubernetes recreated it. That moment was eye-opening — reliability is not just a feature, it is baked into the system. ReplicaSets maintain a desired number of pod replicas at all times.

📦

Deployments — Controlled Evolution

Changed the Nginx image version and watched Kubernetes gracefully replace old pods with new ones using rolling updates — zero downtime. Learned the hard way that using the wrong image tag leads to ImagePullBackOff. Debugging that taught patience and precision.

📈

Horizontal Pod Autoscaler (HPA)

Generated artificial CPU load and watched pods multiply automatically. Then watched them scale back down when the load was removed. It was like watching a system breathe — expanding when stressed, contracting when calm. HPA uses the Metrics Server to monitor resource consumption and trigger scaling decisions.

❤️

Health Probes — Readiness & Liveness

Adding readiness and liveness probes was a turning point. Liveness probes tell Kubernetes when to restart a failing container. Readiness probes tell Kubernetes when a container is ready to serve traffic. Together they ensure only healthy pods receive requests — this is how Kubernetes achieves reliability at scale.

🌐

Services — Opening the Doors

ClusterIP gave internal stability — pods could talk to each other using a stable IP. NodePort opened a door to the outside world through a static port on each node (though WSL2 networking had quirks). LoadBalancer on AKS was the breakthrough: Azure automatically provisioned a public IP address and routed internet traffic directly to my pods. That was the moment it felt like a real production system.

What Was Running on AKS

Internet ↓ Public IP (provisioned automatically by AKS) Azure Load Balancer ↓ Kubernetes Service (type: LoadBalancer) ↓ Nginx Pods (Deployment — 3 replicas) Pod 1 (Node A) Pod 2 (Node B) Pod 3 (Node A) HPA: min 2 pods, max 10 pods — Scales when CPU > 50% — Scales down when CPU drops Liveness Probe: GET /healthz every 10s → restart if 3 failures Readiness Probe: GET /ready every 5s → remove from LB if failing AKS: Azure-managed control plane — Node auto-upgrade — Automatic certificate rotation

Key Insight

The Most Important Combination

Health Probes + Service Types = Production Reliability

The combination of health probes and service types is what transforms a Kubernetes cluster from a container runner into a production system. Health probes ensure only healthy pods serve traffic. LoadBalancer services ensure users reach those pods through a stable, internet-facing endpoint. Together they deliver reliability, scalability, and customer trust — the three pillars of production engineering.

Kubernetes Is Not Just About Containers — It Is About Intentions

You declare what you want (3 replicas, scale when CPU exceeds 50%, restart if health check fails) and Kubernetes makes it happen and keeps it true. The controller loops run continuously, comparing desired state to actual state and reconciling any difference. This is a fundamentally different model from imperative server management.

Managed Kubernetes (AKS) vs Self-Managed

AKS manages the control plane — etcd, API server, scheduler, controller manager — so I focus on workloads, not infrastructure. In a self-managed cluster, a control plane failure is a crisis. In AKS, it is Azure's problem to solve. For a practitioner learning Kubernetes, managed services remove the operational overhead that would otherwise dominate learning time.

KubernetesAKSkubectlHPAHealth ProbesLoadBalancerClusterIPNodePortAzure
Read Full Article on Medium →