Kubernetes study
Offline — showing the cached copy.
Home / Kubernetes Labs

Kubernetes Labs

Learn Kubernetes from first pod to production platform: workloads, networking, storage, scaling, security, delivery, operators, and cost.

The first 24 labs run on a local kind cluster (installed) or k3d. Labs 25–32 then rebuild the environment as a parity copy of your VPS — Ubuntu 20.04, 4 vCPU / 5.8 GB, host nginx on 80/443, Docker/Coolify, the Grafana/Loki stack, SQLite/Postgres, backups — on a disposable VM. Labs 33–34 go deep on operators, ending with a VpsApp operator that deploys your actual app pattern.

The VPS is not a lab target: it already runs Docker, nginx, Coolify and monitoring, and a k3s install there competes for 4 vCPU / 5.8 GB and the same ports. A disposable VM running k3s is the "real node" lab.

Start here: labs/lab-01-cluster-and-kubectl-fundamentals/

Cluster provisioning with Terraform + Ansible is covered in undefined. This track focuses on the objects, operations, security and delivery on top of the cluster.


Prerequisites

ToolWhyNote
Dockercluster nodes as containersinstalled
kinddefault local clusterinstalled
kubectlAPI clientv1.37.1 installed
helmpackaging labsinstalled
kustomizeoverlay labsv5.8.1 installed
k3d or Multipassoptional multi-node / k3sinstall if needed
Go 1.22+operator lab (20)same upgrade as the provider track
stern, k9squality of lifeoptional

Recommended local resources: 4 CPU / 8 GB RAM free for a 3-node kind cluster plus the observability stack. If you have less, use one node and reduce replicas.


Learning path

StageLabsOutcome
1. Core objects01–06Deploy, expose, configure, persist, and debug an app
2. Operate & scale07–11Scheduling, autoscaling, reliability, observability, failure analysis
3. Security12–16RBAC, pod hardening, network policy, supply chain, admission policy
4. Delivery17–19Helm, Kustomize, GitOps
5. Advanced20–23Operators in Go, upgrades/etcd, multi-tenancy/cost, networking internals
6. Capstone24A platform you can defend
7. VPS parity25–32Inventory, parity cluster, strangler migration, real apps, observability, backup/DR, security, capacity/cost
8. Operator depth33–34Webhooks/conversion/lifecycle, then a VpsApp operator capstone

Lab index

#LabLevelFocus
01Cluster and kubectl fundamentalsBeginnerkind, contexts, namespaces, API objects
02Workloads and rolloutsBeginnerDeployments, probes, rollout/rollback
03Services and DNSBeginnerClusterIP, NodePort, headless, CoreDNS
04Ingress and TLSIntermediateingress-nginx, cert-manager, host/path routing
05Config and secretsIntermediateConfigMaps, Secrets, env/volume, external secrets
06Storage and StatefulSetsIntermediatePV/PVC, StorageClass, stable identity, backup
07Scheduling, limits and QoSIntermediaterequests/limits, affinity, taints, PDB
08Autoscaling: HPA, VPA, KEDAAdvancedMetrics, scale-in safety, event-driven
09Reliability, probes and disruptionAdvancedProbes, PDB, drain, graceful shutdown
10Observability and SLOsAdvancedPrometheus, Grafana, Loki, burn-rate alerts
11Debugging and failure modesAdvancedCrashLoop, OOM, Pending, image pulls, DNS
12RBAC and ServiceAccountsAdvancedLeast privilege, token projection, audit
13Security context and Pod SecurityAdvancednon-root, seccomp, capabilities, PSA
14NetworkPolicy and CNIAdvancedDefault deny, selectors, CNI behaviour
15Supply chain securityAdvancedTrivy, cosign, SBOM, admission verification
16Policy as code with KyvernoAdvancedValidate, mutate, generate, exceptions
17Helm chartsIntermediateChart anatomy, values, hooks, tests, OCI
18Kustomize and environmentsIntermediateBases, overlays, patches, promotion
19GitOps with Argo CD or FluxAdvancedSync, drift, waves, rollback
20Operators and CRD developmentExpertGo, controller-runtime, reconcile, finalizers
21Cluster upgrades and etcd backupExpertVersion skew, drain, snapshot, restore
22Multi-tenancy and costExpertQuotas, LimitRange, priority, OpenCost
23Kubernetes networking deep diveExpertCNI, kube-proxy, eBPF, CoreDNS, MTU
24Capstone: production platformExpertEverything, documented and defended
25VPS service inventory and migration mapAdvancedRead-only audit, keep/move decisions
26VPS parity clusterAdvancedUbuntu 20.04 + 4 vCPU / 5.8 GB + host nginx
27Host-nginx strangler migrationAdvancedKeep 80/443, proxy to k3s, canary
28Run the VPS apps on KubernetesAdvancedPortfolio, Mizan, open-webui, API, data
29Observability stack parityAdvancedPrometheus/Loki/Grafana within budget
30Backup and DR parityAdvancedVelero/restic, Floci, restore drill
31Security parityAdvancedControl-by-control VPS mapping
32Capacity and cost parityAdvancedAllocatable, QoS, cost per app
33Operator webhooks and lifecycleExpertDefaulting, validation, conversion, upgrades
34Capstone: VpsApp operatorExpertOne CR to a production app stack

Non-negotiables

  1. Never install k3s on the production VPS without a disposable parity VM and an explicit rollback plan. Ports 80/443/6443 and Docker are already in use. Labs 25–32 use a 4 vCPU / 6 GB Ubuntu 20.04 VM that mimics the VPS; only read-only inspection touches the real host.
  2. Always set requests and limits. A pod without them is a future incident and a cost leak.
  3. Health is not "the pod is Running". Define readiness, liveness and startup behaviour deliberately.
  4. Default deny for NetworkPolicy and RBAC; add back only what is proven necessary.
  5. Pin images by digest in anything you call production.
  6. Tear down clusters and volumes at the end of each lab; local clusters are cheap only when they are stopped.

Workspace convention for your code

~/iac-work/kubernetes/
├── clusters/kind/
├── apps/<app>/{base,overlays}
├── charts/<chart>/
├── policies/
├── gitops/
└── operators/<name>/

Do not put implementation code inside this curriculum folder.

  1. 01Lab 01 — Cluster and kubectl fundamentals
  2. 02Lab 02 — Workloads and rollouts
  3. 03Lab 03 — Services and DNS
  4. 04Lab 04 — Ingress and TLS
  5. 05Lab 05 — Config and secrets
  6. 06Lab 06 — Storage and StatefulSets
  7. 07Lab 07 — Scheduling, limits and QoS
  8. 08Lab 08 — Autoscaling: HPA, VPA, KEDA
  9. 09Lab 09 — Reliability: Probes, PDBs and Disruption
  10. 10Lab 10 — Observability and SLOs
  11. 11Lab 11 — Debugging and Failure Modes
  12. 12Lab 12 — RBAC and Service Accounts
  13. 13Lab 13 — Security Context and Pod Security
  14. 14Lab 14 — Network Policies and CNI
  15. 15Lab 15 — Supply Chain Security
  16. 16Lab 16 — Policy as Code with Kyverno
  17. 17Lab 17 — Helm Charts and Release Lifecycle
  18. 18Lab 18 — Kustomize and Environment Promotion
  19. 19Lab 19 — GitOps with Argo CD and Flux
  20. 20Lab 20 — Operators and CRD Development
  21. 21Lab 21 — Cluster Upgrades and etcd Backup
  22. 22Lab 22 — Multi-Tenancy and Cost Control
  23. 23Lab 23 — Kubernetes Networking Deep Dive
  24. 24Lab 24 — Capstone: Production Platform
  25. 25Lab 25 — VPS Service Inventory and Migration Map
  26. 26Lab 26 — VPS Parity Cluster
  27. 27Lab 27 — Host nginx Strangler Migration
  28. 28Lab 28 — Run VPS Apps on Kubernetes
  29. 29Lab 29 — Observability Stack Parity
  30. 30Lab 30 — Backup and DR Parity
  31. 31Lab 31 — Security Parity
  32. 32Lab 32 — Capacity and Cost Parity
  33. 33Lab 33 — Operator Webhooks and Lifecycle
  34. 34Lab 34 — Capstone: VpsApp Operator