# Mission — Kubernetes

## Why this course exists

**Course 2 of 7** in the deployment/infra track. Course 1 (Containers & Local Dev) ended at the
kind + Skaffold local stack — a *real* Kubernetes cluster that Skaffold deploys Helm charts
into. This course opens that box: **what are the Kubernetes objects Skaffold actually creates,
and how does the cluster keep them running?**

Kubernetes is the single largest topic in the whole `deployments/` domain and the centrepiece
of the learner's interview/cert prep (CKA/CKAD are concrete targets). So this course is the
biggest in the track — a full pass over the objects and control-loop model that every later
course (Helm, Istio, CI/CD, observability) assumes you already know.

## Who the learner is

- Backend engineer on the **conversationmgmt / notification / spike** team — strong Go, gRPC,
  Kafka, Postgres, Airflow, and now containers/local-dev (six courses done).
- **Newer to Kubernetes.** Pods, Deployments, Services, autoscaling, scheduling are new. Assume
  strong backend maturity, NOT ops/K8s fluency.
- Directly relevant hook: **`tom` and `conversationmgmt` (their own service) are StatefulSets**,
  while most services are Deployments. That contrast is a recurring anchor.
- Uses the kind+Skaffold local stack, so "the pods on my laptop" is a real, pokeable anchor.

## What "success" looks like

By the end, the learner can, from memory:

1. Explain what Kubernetes is — declarative desired-state + the reconciliation control loop —
   and name the control-plane vs node components (api-server, etcd, scheduler,
   controller-manager, kubelet, kube-proxy).
2. Explain the workload hierarchy: **Pod → ReplicaSet → Deployment**, and how a rolling update
   works (new RS scaled up while old scaled down).
3. Expose and connect workloads with **Services** (ClusterIP / headless / NodePort /
   LoadBalancer) and in-cluster DNS.
4. Inject config with **ConfigMaps/Secrets**, and say when to use a **StatefulSet** over a
   Deployment (stable identity + ordered, persistent) — with `tom`/`conversationmgmt` as the
   example.
5. Configure **health** (liveness/readiness/startup probes) and **resources**
   (requests/limits), and explain scheduling (labels/selectors, affinity, taints/tolerations).
6. Explain **autoscaling** (HPA, VPA, and KEDA `ScaledObject`s — the repo's approach) and
   **availability** (PodDisruptionBudgets, the termination lifecycle).
7. Explain **namespaces + RBAC + ServiceAccounts** and how they map to the env×org model.

## Grounding

Every concept lands on a real object in this repo's Helm templates / manifests (mapped in
[reference/repo-kubernetes-map.md](./reference/repo-kubernetes-map.md)). Honest caveat: this
repo authors K8s almost entirely **through Helm templates** — you rarely hand-write a manifest.
So lessons teach the *object* (what CKA/interviews test) and point at the *template that
generates it*, noting that the templating mechanics are Course 3 (Helm). External claims cite
the official Kubernetes docs + KEDA docs ([RESOURCES.md](./RESOURCES.md)) — never my memory.

## The seven-course plan (this track)

1. Containers & Local Dev ✅ (done)
2. **Kubernetes** ← *you are here*
3. Helm — how the repo templates these objects (~106 charts, SOPS secrets)
4. Istio & Service Mesh — the networking layer on top of Services
5. CI/CD & Delivery — how these manifests reach real clusters
6. Observability & Monitoring — Prometheus/Grafana/Thanos/Jaeger/OTel
7. Infrastructure as Code — Terraform/GCP/GKE/Workload Identity (the cluster underneath)
