Kubernetes Simulator

advanced · ~15 min

Checkout first

Ticket from Leo Martins, customer support

Customers are writing in: "checkout spins forever", "is your site down?". It started when the nightly reports kicked off. My guess is a server crashed?

The reports (batch) have to finish today too, so please don't just switch them off. checkout.yaml and batch.yaml are in the working directory.

Priority and preemption

A PriorityClass gives pods a number; priorityClassName in a pod spec picks one. When a pod can't fit, the scheduler may evict lower-priority pods on a node to make room — preemption. The evicted pods go back to Pending like any other. Two classes are built in for system pods. Docs

Objectives

  • checkout: 1 ready replica
  • checkout runs at a higher priority than batch
  • batch keeps its spec: 4 replicas asking for 5 CPUs each
  • Bonus: Delete no pod by hand: let the scheduler choose what gives way

Best on a computer with a keyboard. It works on a phone, with shortcuts under the terminal.