Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Introduction

You know Docker. You’ve written Compose files. You’ve built images, connected containers, and mounted volumes. Now your app needs to survive the real world — scaling, self-healing, zero-downtime deploys, secrets management, and multi-service coordination at scale. That’s what this book teaches.


What You’ll Build

By the end of this book, you’ll have deployed KubeShop — a five-service microservices e-commerce app — to both a local Minikube cluster and a production-grade Azure Kubernetes Service (AKS) cluster, complete with Helm packaging, autoscaling, RBAC, and a full CI/CD pipeline.

graph LR
    U([User]) --> W[web :3000\nAPI Gateway]
    W --> C[catalogue :3001]
    W --> CA[cart :3002]
    W --> O[orders :3003]
    W --> P[payment :5000]
    C --> MDB1[(MongoDB)]
    O --> MDB2[(MongoDB)]
    CA --> R[(Redis)]

The stack: Node.js · Python · MongoDB · Redis · Docker · Kubernetes · Helm · GitHub Actions · ArgoCD · AKS


Prerequisites

You need these before starting. Run the check commands — if they pass, you’re good to go.

ToolVersionCheckExpected Output
Docker20+docker --versionDocker version 20.x...
kubectl1.28+kubectl version --clientClient Version: v1.28...
Minikube1.32+minikube versionminikube version: v1.3...
Helm3.xhelm versionversion.BuildInfo{Version:"v3...
Gitanygit --versiongit version 2...

💡 Tip: On Ubuntu/Debian, the quickest setup is:

# kubectl
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl

# minikube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

# helm
curl https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

How to Use This Book

Each chapter is designed to take 30–60 minutes and ends with a hands-on lab. The pattern is always:

Concept (short) → Example (immediate) → Try it → Break it
  • Read linearly if you’re new to K8s.
  • Jump around if you have experience — every section is self-contained.
  • Do the labs. Reading about K8s is like reading about swimming. You have to get in the water.

🔥 The “Break It!” philosophy: The fastest way to understand a system is to watch it fail. Every chapter has intentional breakage exercises. Don’t skip them.


Chapter Roadmap

#ChapterTimeYou’ll Be Able To
1The Container Orchestration Problem~45 minExplain why K8s exists and navigate a live cluster
2kubectl — Your Swiss Army Knife~40 minQuery and control any K8s resource from the CLI
3Pods — The Atomic Unit~50 minCreate, debug, and destroy pods with confidence
4Workload Controllers~55 minDeploy apps with zero-downtime rolling updates
5Services~45 minConnect pods across namespaces using DNS
6Ingress — HTTP Routing~50 minRoute external traffic with NGINX and TLS
7ConfigMaps and Secrets~40 minExternalize config and manage sensitive data
8Storage~45 minPersist data across pod restarts
9KubeShop Project~60 minContainerize a real 5-service microservice app
10Deploying KubeShop~60 minDeploy a full microservices stack to Minikube
11Health Checks & Self-Healing~45 minConfigure probes and run chaos experiments
12Helm~55 minPackage and template K8s apps with Helm
13Scheduling & Autoscaling~50 minAutoscale under load and control pod placement
14Security~55 minLock down a cluster with RBAC and Network Policies
15Observability~60 minSet up Prometheus, Grafana, and log aggregation
16CI/CD with GitHub Actions~55 minBuild a full GitOps pipeline with ArgoCD
17Azure Kubernetes Service~60 minDeploy KubeShop to a production cloud cluster
18K8s Internals~40 minExplain what happens when you run kubectl apply
19Troubleshooting Playbook~35 minDebug any pod, network, or storage failure

Ready? Let’s go to Chapter 1. →