Week 5: A real cluster
Week 5: A real cluster
The manifests from last week meet a real cluster. Terraform and Ansible build a k3s cluster, first one node and then three, and you deploy by hand. Then you give the databases storage that outlives their pods and teach Kubernetes what a healthy pod is.
Keep the 2 GB flavor you chose in week 1. k3s does not run well on 1 GB.
Issues
Work through the issues in order, in your own repository. Each one builds on the one before.
| Issue | What you do |
|---|---|
k3s-one-node | Replace the single server with a one-node k3s cluster and reach it with kubectl. |
deploy-manually | Your manifests on the cluster, with the image from GitLab's registry and Traefik as Ingress. |
add-nodes | Change one number in Terraform and the cluster has three nodes. |
persistent-storage | PersistentVolumeClaims for MongoDB and Redis. |
health-checks | Readiness and liveness probes, tested against a bad update. |
Write the week report in report/week-5.md after the last issue.
Slide decks
Each deck is a self-study lecture of about 15–20 minutes, except the intro, which takes about five.
- Week 5 intro: what the week asks of you
- The cluster: k3s, server and agent nodes, and single points of failure
- Ingress: getting traffic from the internet to a Service
- Storage: PersistentVolumes and what ties a database pod to a node
- Health checks: readiness against liveness
Reading material
docs/K3S.md,docs/TERRAFORM.md,docs/KUBERNETES.mdin your repo- k3s documentation
- Ingress
- Persistent Volumes
- Liveness, readiness and startup probes