Skip to content

Linux Foundation Black Friday Sale: Up to 65% off Save now

Back to the blog
Glossary6 min read

What is a Kubernetes operator? A plain explainer

Sajeeva Nambadawa Vithanage27 Nov 2026 · Senior Software Site Reliability Engineer

A Kubernetes operator is a piece of software that runs in your cluster and looks after an application the way a person would: installing it, backing it up, upgrading it and fixing it when it drifts. If you've ever wondered what is a Kubernetes operator, the short answer is a custom resource plus a controller that acts on it.

The Kubernetes docs put it in one line: "Operators are software extensions to Kubernetes that make use of custom resources to manage applications and their components." This explainer unpacks that sentence, with a small example you can run, and shows where operators turn up in the CKAD.

Key points

  • An operator = a custom resource (a new kind of object in the Kubernetes API) + a controller that watches it and does the work.
  • It follows the same control loop as built-in Kubernetes: compare desired state with actual state, then act to close the gap.
  • You install an operator by applying its CustomResourceDefinition (CRD) and running its controller, usually as a Deployment.
  • The CKAD curriculum asks you to "discover and use resources that extend Kubernetes (CRD, Operators)".

What is a Kubernetes operator, in plain terms

Kubernetes already knows how to keep three replicas of a Deployment running. It doesn't know that your database needs a backup before an upgrade, or that a schema change has to run before the new version starts. That knowledge usually sits in a runbook, or in someone's head.

An operator writes that knowledge down as code. You describe what you want in a custom object ("a database called orders, version 16, backed up nightly") and the operator's controller makes it so, then keeps it so.

The Kubernetes docs list the kind of work operators take on:

  • deploying an application on demand;
  • taking and restoring backups of its state;
  • upgrading the application together with related changes such as database schemas or configuration;
  • publishing a Service for applications that can't discover each other through the Kubernetes API;
  • simulating failures to test resilience;
  • choosing a leader for a distributed application that has no election of its own.

The two building blocks: custom resources and controllers

Custom resources

A custom resource adds a new kind of object to the Kubernetes API. Once it exists, kubectl get, kubectl apply and kubectl delete work on it like they do on Pods. The usual way to add one is a CustomResourceDefinition (CRD). The other route, API server aggregation, is far less common.

On its own, a custom resource just stores structured data. Nothing happens when you create one.

Controllers

A controller is "a control loop that watches the shared state of the cluster through the apiserver and makes changes attempting to move the current state towards the desired state". Every Deployment, ReplicaSet and Job in your cluster is managed by one.

Put a controller on top of a custom resource and you get a declarative API for your own application. That combination is the operator pattern.

A small example: a CRD you can apply

This is the CronTab example from the Kubernetes docs, slightly trimmed. It defines a new kind, CronTab, in the group stable.example.com:

apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: crontabs.stable.example.com
spec:
  group: stable.example.com
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                cronSpec:
                  type: string
                image:
                  type: string
                replicas:
                  type: integer
  scope: Namespaced
  names:
    plural: crontabs
    singular: crontab
    kind: CronTab
    shortNames:
    - ct

Apply it, then create an object of the new kind:

apiVersion: "stable.example.com/v1"
kind: CronTab
metadata:
  name: my-new-cron-object
spec:
  cronSpec: "* * * * */5"
  image: my-awesome-cron-image
kubectl apply -f resourcedefinition.yaml
kubectl apply -f my-crontab.yaml
kubectl get crontab
kubectl get ct -o yaml

The API server now stores CronTab objects, and kubectl lists them by their plural, singular or short name. Nothing runs yet, because there's no controller. Write a controller that watches CronTab objects and creates Jobs from them, and you have a (very small) operator.

How a real operator behaves

The docs walk through an imaginary database operator with a custom resource called SampleDB. When you create a SampleDB, its controller creates PersistentVolumeClaims, a StatefulSet to run the database and a Job for the first-time setup. When you delete it, the controller takes a snapshot first, then removes the StatefulSet and volumes. Along the way it schedules backup Pods and, when the database is on an old version, creates Jobs to upgrade it.

Using it feels like using any other Kubernetes object:

kubectl get SampleDB
kubectl edit SampleDB/example-database

A real one you'll meet in observability work is the OpenTelemetry Operator. It adds kinds such as Instrumentation, and injects auto-instrumentation into Pods that carry an annotation. Our OpenTelemetry project page has more on it.

Operator vs Helm chart, and operator vs ConfigMap

A Helm chart installs an application: it renders templates and applies them. After that, Helm isn't watching. An operator keeps running and keeps acting, which is why operators tend to appear for stateful software where day-two work (backups, upgrades, failover) is the hard part. Plenty of operators are themselves installed with a Helm chart.

The Kubernetes docs also give a useful test for when a custom resource beats a ConfigMap. Choose a ConfigMap when there's an existing config file format, the whole thing fits in one key and a program in a Pod just reads it. Choose a custom resource when you want kubectl get my-object to work, follow the .spec and .status conventions, and build automation that watches the object and reacts to changes.

How operators are built

You don't write the watch loop from scratch. The Kubernetes docs list several frameworks, including kubebuilder and the Operator Framework (Go), the Java Operator SDK, Kopf (Python), kube-rs (Rust), KubeOps (.NET), Metacontroller and shell-operator. Pick the one in the language your team already writes.

What operators mean for the CKAD

The CKAD's largest domain, Application Environment, Configuration and Security (25%), includes "discover and use resources that extend Kubernetes (CRD, Operators)". In practice that means being comfortable with:

  • kubectl get crd to see which custom kinds a cluster has;
  • kubectl explain <kind> and kubectl get <kind> -o yaml to read one;
  • creating and editing a custom object from an existing CRD.

You won't be asked to write a controller. Pro tip: apply the CronTab example above on a practice cluster and run kubectl explain crontab.spec; it's a two-minute habit that makes custom resources feel ordinary. When you're ready to book, the CKAD discount page lists the current codes.

FAQ

What is the difference between a controller and an operator? Every operator contains a controller, but not every controller is an operator. An operator is a controller for a custom resource that encodes how to run a specific application.

What is a Kubernetes operator used for? Running software that needs ongoing care, such as databases, message queues and monitoring stacks: installing it, backing it up, upgrading it and recovering it.

Is a CRD the same as an operator? No. A CRD only adds a new object type to the API. It becomes an operator when a controller watches those objects and acts on them.

Do I need to know operators for the CKA or CKAD? The CKAD curriculum lists CRDs and operators explicitly. You need to find and use them, not build them.

Apply a CRD on a test cluster today, and the next operator you meet will make sense.

Sources