Node fleet, mission 7 of 8
Not on spot
advanced, about 12 minutes, in the Kubernetes Simulator
Opens once you pass All on one.
The briefing
From Priya Raman, senior backend developer at Larchwood (a fictional company)
search was evicted twice this week. Both times hackademy-worker was reclaimed — it's a spot node, and search's nodeSelector asks for disk: ssd, which only that node has.
search must never run on a spot node. It's faster on ssd, so it should still prefer ssd wherever that's allowed. Losing it hurts more than a slow disk. search.yaml is the manifest.
What you'll do
- search: 2 ready replicas, none on a spot node
- search's template rules out spot nodes
- …and still prefers ssd
- Bonus star: Read the nodes' labels before changing anything
The mission checks the cluster, not your keystrokes: any fix that works, passes.
Concepts
Node affinity
nodeSelector with more words.
Read the Kubernetes docsrequired…terms filter nodes with operators In, NotIn, Exists and DoesNotExist, so it can say "never on spot".preferred…terms add a weight (1–100) to nodes that match, so the scheduler favours them without insisting.
More Node fleet missions
- 1. The right hardware
- 2. Reserved seating
- 3. It doesn't fit
- 4. Kernel patch
- 5. One basket
- 6. All on one
- 7. Not on spot
- 8. Checkout first