Copy as MarkdownCtrl+⇧+C
Chapter 50: Kubernetes for AI Services
You build the kubernetes-deployment skill first, then refine it through core and optional lessons. The FastAPI agent from Part 6 is the running example you deploy and harden on Kubernetes.
Goals
- Understand Kubernetes architecture (control plane, nodes, declarative model)
- Deploy and operate workloads: Pods, Deployments, Services, Jobs, CronJobs
- Configure apps with ConfigMaps/Secrets and namespace isolation
- Manage resources and scaling: requests/limits, HPA, rolling updates
- Secure clusters with RBAC, health probes, and best practices
- Use kubectl-ai to generate/evaluate manifests
- Produce a reusable Kubernetes deployment skill
Lesson Progression
| # | Lesson | Focus |
|---|---|---|
| 0 | Build Your Kubernetes Skill | Scaffold from docs |
| 1-5 | Fundamentals | Architecture, Pods, Deployments, Services |
| 6-12 | Production Essentials | Namespaces, config, resources, HPA, RBAC, probes, batch |
| 13 | AI Collaboration | kubectl-ai for manifests and ops |
| 14 | Capstone: Deploy Agent | Production deployment of the Part 6 API |
| 15 | Test and Refine Skill | Validate cross-application transferability |
| 16-22 (Optional) | Advanced Patterns | Init/sidecars, ingress, discovery, stateful workloads, storage, deep security |
Each lesson ends with a reflection to test, find gaps, and improve the skill.
Outcome & Method
You finish with your Part 6 FastAPI agent running on Kubernetes—secured, health-checked, and autoscaled—plus a Kubernetes deployment skill. The 4-Layer progression moves from fundamentals to AI-assisted manifests to a spec-driven capstone, with optional deep dives for advanced scenarios.
Prerequisites
- Chapter 49 container image pushed to a registry
- Docker Desktop with Kubernetes enabled (or equivalent local cluster)
- Terminal familiarity; Kubernetes experience not required (Lesson 1 covers basics)