>DevOps Interview KB

A team wants to automate a repetitive operational task with a custom Kubernetes operator — when is that actually the right tool versus overkill?

AdvancedArchitectureScenarioKubernetes7 min read

Short Answer

A custom operator is worth building when the task genuinely needs continuous, ongoing reconciliation against a changing desired state (not a one-time or scheduled action), when the domain is complex enough that expressing it as a declarative custom resource genuinely simplifies how users interact with it, and when no existing operator or tool already does the job — for a one-off provisioning task, a simple script or CronJob is almost always sufficient and meaningfully cheaper to build and maintain.

Detailed Explanation

An operator is a real piece of production software with real ongoing costs, not a free automation shortcut — the decision has to weigh the task's actual operational shape and the domain's genuine fit for a declarative API against that ongoing cost, rather than reaching for the pattern because it's the "Kubernetes-native" way to automate something.

Requirements

  • The task should be evaluated against its actual operational shape (one-time action vs. ongoing reconciliation) before choosing a solution.
  • Whatever solution is chosen needs to be maintainable long-term by the team that owns it, not just quick to initially build.
  • The decision should account for the real ongoing cost of running and maintaining an operator, not just the initial development effort.

Architecture

The core question: does this task need continuous reconciliation, or is it a one-time/scheduled action?: an operator's entire value proposition is watching a custom resource continuously and reconciling actual state toward desired state as either changes over time — a task that's genuinely "run once and you're done" (a one-time database provisioning script) or "run on a fixed schedule regardless of any changing desired state" (a nightly backup) doesn't need this continuous reconciliation model at all; a CronJob or a simple imperative script/pipeline step is a better fit and meaningfully simpler to build and operate.

A custom operator earns its complexity when the domain benefits from a declarative API: if users (other teams, or automation) genuinely benefit from expressing "I want a database with these properties" as a Kubernetes-native custom resource — getting kubectl get databases, RBAC scoped to that resource type, and GitOps-style declarative management for free — the operator pattern's value is real; if the actual interaction pattern is simpler (a one-time provisioning request that doesn't need ongoing management as a first-class API object), that value doesn't materialize.

Check whether an existing operator already solves this before building a custom one: the Kubernetes operator ecosystem is large and mature for many common domains (databases via operators like Zalando's Postgres Operator or CloudNativePG, certificate management via cert-manager, and many others) — building a custom operator for a problem an existing, maintained, community-supported operator already solves is usually a worse investment than adopting and configuring the existing one, even if it doesn't fit the exact use case perfectly out of the box.

The ongoing maintenance cost of a custom operator is real and easy to underestimate: an operator is a long-running piece of production software — it needs its own testing, versioning, upgrade strategy, monitoring, and on-call ownership, same as any other service, and its failure modes (a broken reconcile loop silently not reconciling, a controller crashlooping) can be subtle and hard to detect — this ongoing cost, not just the initial build effort, is what should be weighed against the value of the declarative-API/continuous-reconciliation properties it provides.

A simpler middle ground often exists: for tasks that need some automation and some structure but not full continuous reconciliation, a CronJob running a script against the Kubernetes API (or an external system), or a CI/CD pipeline step triggered by a Git-based declarative config change (without a full custom-resource-plus-controller model), can capture much of the benefit at a fraction of the operator's ongoing complexity — worth explicitly considering as an option before committing to the full operator pattern.

Trade-offs

Building a custom operator is the right investment specifically when the task's actual shape (continuous reconciliation, complex domain benefiting from a declarative API, no existing tool fits) genuinely matches what an operator provides — building one when a simpler tool would do trades real, ongoing maintenance burden for capability that isn't actually being used. Conversely, forcing a genuinely continuous-reconciliation problem into a CronJob-based script (repeatedly running the same imperative logic on a schedule, hoping it converges) often ends up reinventing a worse, less-reliable version of what an operator's reconciliation loop would provide correctly.

Interview Follow-Up Questions

  • How would you evaluate an existing open-source operator's maturity and production-readiness before adopting it, versus building something custom?
  • What would you do if an existing operator solves 90% of the need but is missing one genuinely important capability — extend it, fork it, or build custom?
  • How would you design the ownership and on-call model for a custom operator, given it becomes production infrastructure other teams may come to depend on?

Key Takeaways

  • The core decision factor is whether the task needs genuinely continuous reconciliation against changing desired state, versus being a one-time or scheduled action better served by a simpler tool.
  • A custom operator earns its complexity when the domain benefits from a real declarative Kubernetes-native API (kubectl get, RBAC, GitOps) that users would genuinely interact with as a first-class resource.
  • Check for an existing, maintained operator solving the same problem before building a custom one — the ecosystem is mature for many common domains.
  • The ongoing maintenance cost (testing, versioning, monitoring, on-call) of running a custom operator as production software is real and often underestimated relative to the initial build effort.

References

Last updated August 22, 2026 · Last reviewed August 22, 2026