Lesson 15 · Senior Kubernetes judgment
Stateful identity, storage, and when StatefulSet is a fit
How to reason about when a StatefulSet is truly justified, when it is a workaround for another design problem, and how this repo’s non-textbook usage still teaches the right senior lessons.
Your win: explain when StatefulSet is a real fit, when it may signal a design smell, and how to discuss the repo’s own usage honestly instead of pretending every StatefulSet is a textbook database case.
Why this page is worth lingering on
Many Kubernetes explanations make StatefulSet sound like “the serious workload object.” That is a bad instinct. StatefulSet is not “more production.” It is simply the right tool when the workload’s identity and lifecycle constraints are stronger than what a Deployment can model comfortably.
This is why the repo’s usage is such a good senior teaching case. The StatefulSets here are not the most textbook example: they are not primarily databases with the classic headless-service-plus-per-pod-PV story. Instead, they are used mainly for stable identity and ordered behavior. That matters because it teaches you to reason from required guarantees, not from cargo-cult patterns.
And that is the real tone shift from intermediate to senior thinking. You stop asking “which object sounds stronger?” and start asking “which guarantees does this workload actually need?”
What the repo teaches well
In this repo, conversationmgmt and tom are the exceptions, not the rule. Most backend services are perfectly well modeled as Deployments. That contrast is powerful. It keeps the default honest: stateless clones should stay Deployments unless the workload really requires more.
It also creates a great senior review question: “What specific guarantee would break if this were converted to a Deployment?” If the answer is vague, the StatefulSet choice may be weak. If the answer clearly names stable identity, ordering, or per-instance coordination, the choice becomes easier to defend.
conversationmgmt and tom invoke the shared StatefulSet path, while most other services remain on the standard Deployment path from libs/util/templates/_deployment.tpl.What stronger answers sound like
The strongest answers here sound specific: “StatefulSet is justified when the workload contract needs stable identity, ordering, or per-pod state. In this repo, the key teaching point is that only two backend business services need that path, and even there the reasoning is more about stable identity than a textbook database pattern.”
That answer is stronger because it respects the actual guarantees instead of flattening everything into “StatefulSet means stateful app.”
How to get the most out of this page
When you review StatefulSet examples, keep forcing yourself to name the broken guarantee. If you cannot say what would fail under a Deployment, your argument probably is not strong enough yet.
Re-read the StatefulSet docs, then compare the repo’s deviations
Look at the official guarantees, then compare them to how the repo uses StatefulSets in practice.
Check yourself (from memory)
Q1. When is StatefulSet the right default choice?
Sources. Kubernetes StatefulSet docs; repo K8s map.