> ## Documentation Index
> Fetch the complete documentation index at: https://notes.kodekloud.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Working Operator Versus Production Operator

> Explains how to transform a working Kubernetes operator into a production-ready operator by adding testing, observability, RBAC, upgrade plans, clear status/events, and repeatable packaging for maintainability and trust

The key question at the end of an operator project is not just “does it run?” A working operator may reconcile a demo Custom Resource (CR) in a dev environment, but a production-minded operator is one that someone else can explain, observe, upgrade, and trust.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/_cG0RWHUHqfjYKx0/images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/working-to-production-minded-operator-transition.jpg?fit=max&auto=format&n=_cG0RWHUHqfjYKx0&q=85&s=e73e59aea74cb171f38e7f5ce8bc36b9" alt="The image illustrates the transition from a &#x22;Working operator&#x22; that &#x22;reconciles a demo object&#x22; to a &#x22;Production-minded operator&#x22; that is explained, observed, upgraded, and trusted, ultimately gaining the trust of users." width="1920" height="1080" data-path="images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/working-to-production-minded-operator-transition.jpg" />
</Frame>

This distinction matters because operators usually become part of other teams’ platforms. A cluster may still accept the YAML, but if the operator is unclear, silent, or hard to recover, platform teams won’t know whether the system is healthy or how to respond.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/_cG0RWHUHqfjYKx0/images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/accepted-not-same-healthy-diagram.jpg?fit=max&auto=format&n=_cG0RWHUHqfjYKx0&q=85&s=63b1473c68dc76916a405f1a46b5d0a2" alt="The image shows a diagram with the title &#x22;Accepted Is Not the Same as Healthy,&#x22; illustrating a process involving &#x22;Your operator,&#x22; &#x22;Another team,&#x22; and an outcome labeled &#x22;Unclear.&#x22;" width="1920" height="1080" data-path="images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/accepted-not-same-healthy-diagram.jpg" />
</Frame>

A compact web-app operator is a useful pattern to demonstrate the production shape of an operator without implying the sample project is a finished enterprise product. In this pattern:

* The Custom Resource (CR) is the contract describing user intent.
* The reconcile loop is the convergence and repair mechanism that turns intent into reality.
* Deployments, Services, ConfigMaps, and other Kubernetes resources are the managed “real-world” work.
* Status fields and Kubernetes Events are the signals that users and platform operators read to understand changes.

Production readiness wraps practical operational concerns around that core loop. The API should stay small and stable. The controller must keep making forward progress as cluster state changes. Deletion should be deliberate and recoverable. Status and events should tell a coherent story. Packaging and deployment must be repeatable so another engineer can run the operator without guessing.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/_cG0RWHUHqfjYKx0/images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/production-readiness-diagram-loop-flow.jpg?fit=max&auto=format&n=_cG0RWHUHqfjYKx0&q=85&s=f93a219ead3b1eae8694d3c56371e625" alt="The image is a diagram titled &#x22;Production Readiness Wraps the Loop,&#x22; showing a circular flow with elements indicating attributes like &#x22;API small and stable,&#x22; &#x22;Keeps making progress,&#x22; &#x22;Deletion deliberate,&#x22; and &#x22;Status tells a story.&#x22;" width="1920" height="1080" data-path="images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/production-readiness-diagram-loop-flow.jpg" />
</Frame>

These production checks do not replace the code you wrote; they frame and harden it. Tests, permissions, metrics, upgrade plans, and documentation are not “extras” — they are essential practices that make the operator dependable in shared environments.

<Callout icon="lightbulb" color="#1CB2FE">
  Production-readiness checklist (practical items to include):

  * Unit and integration tests that validate the reconcile loop and failure cases.
  * Least-privilege RBAC and a clear, documented permissions model.
  * Metrics, liveness/readiness probes, and health endpoints for observability.
  * Upgrade and rollback strategies for both CR schemas and controller versions.
  * Intuitive status fields and user-facing Kubernetes Events that explain state changes.
</Callout>

Below is a compact reference to the operator’s core responsibilities and where to apply production practices.

| Component            |                  Role in the operator pattern | Example best practice                              |
| -------------------- | --------------------------------------------: | -------------------------------------------------- |
| Custom Resource (CR) |                      Contract for user intent | Keep schema minimal and versioned                  |
| Reconcile loop       |                  Convergence and repair logic | Test idempotency and error handling                |
| Managed resources    | Real Kubernetes objects the operator controls | Use declarative manifests and ownership            |
| Status & Events      |      Signals for users and platform operators | Populate status with actionable messages           |
| Packaging & Deploy   |      How operators are delivered and upgraded | Provide reproducible images and Helm/Trait bundles |

Helpful references:

* [Kubernetes API concepts](https://kubernetes.io/docs/concepts/overview/kubernetes-api/)
* [Operator pattern and best practices](https://kubernetes.io/docs/concepts/extend-kubernetes/operator/)
* [Operators SDK](https://sdk.operatorframework.io/)

Carry forward two main ideas.

First, the web-app operator proves the core loop: desired state is expressed via a Custom Resource and the controller keeps real resources aligned with that request.

Second, production readiness is the discipline of making that loop understandable and trustworthy for the next person who will operate or inherit the system.

<Frame>
  <img src="https://mintcdn.com/kodekloud-c4ac6d9a/_cG0RWHUHqfjYKx0/images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/core-loop-production-readiness-diagram.jpg?fit=max&auto=format&n=_cG0RWHUHqfjYKx0&q=85&s=281a3fc8396fdd565b890c0d726ba800" alt="The image outlines two key ideas: &#x22;The core loop, proven,&#x22; which emphasizes desired to real processes kept in sync, and &#x22;Production readiness.&#x22;" width="1920" height="1080" data-path="images/Kubernetes-Operators/Production-Readiness-Testing-Wrap-Up/Working-Operator-Versus-Production-Operator/core-loop-production-readiness-diagram.jpg" />
</Frame>

Use that lens for the finish line: the web-app operator demonstrates the pattern end-to-end, and production-readiness practices make the operator maintainable, observable, and safe for operators who inherit it.

<CardGroup>
  <Card title="Watch Video" icon="video" cta="Learn more" href="https://learn.kodekloud.com/user/courses/kubernetes-operators/module/708138ee-3fe0-42cd-b135-8e7df5f7ef59/lesson/a701472e-75cc-4b68-973e-ab1b93a76d38" />
</CardGroup>
