Week 13: Production Kubernetes — Clusters, Networking, RBAC
Theme: Build and operate production-grade Kubernetes clusters.
Learning Objectives
- Provision a multi-node Kubernetes cluster with kubeadm or kOps
- Configure networking policies (Calico, Cilium)
- Implement RBAC with least-privilege principles
- Manage node pools, taints/tolerations, affinity rules
Reading Materials
- Kubernetes the Hard Way (Kelsey Hightower)
- kOps Documentation
- Calico Network Policies
- Cilium Documentation
- Kubernetes RBAC
- Kubernetes Production Best Practices (AWS)
- Kubernetes Security Best Practices (Google)
Finger Exercises (choose 2)
- Write a NetworkPolicy that allows only the Go app to talk to the Python worker on port 8080. Deny all other ingress.
- Create a ServiceAccount for the Go app. Bind it to a Role with least privilege (only get/list pods, create events).
- Set up node affinity: schedule the Go app on nodes with label
workload=services, Python worker onworkload=workers.
Project
- Provision a cluster (on AWS/GCP or locally with kubeadm VMs): 1 control plane + 2 workers
- Configure Cilium as CNI with network policies:
- Default deny ingress/egress
- Allow ingress to Go app on port 8080 from Ingress controller
- Allow Go app egress to Python worker on port 8081
- Allow all pods egress to DNS (port 53 UDP)
- Set up RBAC:
developerrole: get/list/watch pods, services, deployments indevnamespaceopsrole: full access toprodnamespaceviewerrole: read-only across all namespaces
- Configure taints/tolerations: Python worker runs on spot/preemptible instances, Go app runs on on-demand instances
- Write a
CLUSTER_SETUP.mddocumenting the cluster architecture, networking, and access control
Time Budget
| Activity | Time |
|---|---|
| Reading | 2 hrs |
| Finger exercises | 1.5 hrs |
| Project | 2.5 hrs |
| Total | 6 hrs |