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.

IssueWhat you do
k3s-one-nodeReplace the single server with a one-node k3s cluster and reach it with kubectl.
deploy-manuallyYour manifests on the cluster, with the image from GitLab's registry and Traefik as Ingress.
add-nodesChange one number in Terraform and the cluster has three nodes.
persistent-storagePersistentVolumeClaims for MongoDB and Redis.
health-checksReadiness 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