Signal9Signal9 — home
online
back to labs

Kubernetes: Keep N Replicas Alive

MediumDevOps15-20 min
The brief

The manifest at /root/case/deployment.yaml is a bare Pod — nothing recreates it when it dies, and it can't do rolling updates. Rewrite it as a Deployment that keeps the assigned number of replicas running. Read /root/case/assignment.env for the app name (APP), container image (IMAGE), and desired replica count (REPLICAS). The Deployment needs kind: Deployment, the replica count, and a label selector (spec.selector.matchLabels) that matches its Pod template's labels. Grading reads the manifest YAML.

What you'll do
  • Change the object to a Deployment (kind: Deployment, apps/v1)
  • Set the desired replica count
  • Add a label selector that matches the Pod template labels

Hands-on lab: you work on a real Linux box in your browser, graded on the machine's actual state.