Kahibaro
Discord Login Register

What are Operators

Concept and Motivation

In Kubernetes and OpenShift, many platform features and add‑ons start as “someone’s controller + a bunch of YAML + runbooks.” As clusters grow, this model becomes hard to operate and standardize.

Operators were introduced to solve this by turning operational knowledge into software:

In OpenShift, Operators are central to how the platform itself is installed, configured, and kept healthy.

Definition

An Operator is:

A Kubernetes controller (or set of controllers) that uses Custom Resource Definitions (CRDs) to manage a specific application or capability, automating its lifecycle in a way that mimics a skilled human operator.

Key characteristics:

Core Building Blocks

While detailed mechanics belong to later chapters, it is important here to understand the basic ingredients that make an Operator:

What Problems Operators Solve

Operators aim to remove manual, error‑prone procedures and replace them with consistent automation that works across clusters and environments. Typical challenges they address:

How Operators Differ from Plain YAML and Helm Charts

Without Operators, you typically:

Operators differ in several ways:

Types and Levels of Operators

Not all Operators are equally sophisticated. They vary in what parts of the lifecycle they automate.

Common capabilities levels (conceptually):

  1. Basic install/configure
    • Install components when a CR is created.
    • Update resources when CRs change.
  2. Upgrades and version management
    • Coordinate rolling upgrades.
    • Understand version compatibility and block unsafe transitions.
  3. Health management and repair
    • Detect pod or instance failures and recreate/replace them.
    • Reconcile replication factors or cluster membership.
  4. Day‑2 operations
    • Perform and manage backups/restores.
    • Run scheduled maintenance tasks and tuning.
  5. Autonomous operations
    • Reactive scaling or topology changes based on metrics.
    • Policy‑driven reconfiguration or failover.

In OpenShift, you will encounter Operators at multiple levels of sophistication, depending on their purpose.

Operators in the OpenShift Context

While the overall “Operators and Platform Services” chapter covers the ecosystem and management aspects, this section focuses on what distinguishes Operators in OpenShift’s design:

Example: High-Level Operator Workflow

Conceptually, using an Operator looks like this:

  1. The Operator (and its CRDs) are available in the cluster.
  2. A user creates a custom resource, for example:
   apiVersion: example.com/v1
   kind: ExampleApp
   metadata:
     name: example
   spec:
     replicas: 3
     storageSize: 100Gi
     enableTLS: true
  1. The Operator:
    • Sees this new ExampleApp CR.
    • Creates/updates Deployments, Services, PersistentVolumeClaims, Secrets, etc.
    • Configures the application to run with 3 replicas, 100Gi storage, TLS enabled.
  2. If a node fails or a pod is deleted:
    • Kubernetes restarts pods.
    • The Operator may also:
      • Reassign roles in the cluster.
      • Reconfigure peers.
      • Ensure the application remains in the desired state.
  3. If the user edits the CR to change replicas: 5:
    • The Operator adjusts the underlying resources and application configuration accordingly.

Benefits and Trade-Offs

Benefits

Trade‑offs

When to Use Operators

In the context of OpenShift, Operators are especially suitable when you need to:

Later chapters will cover how Operators are installed, managed, and which platform services they typically provide in OpenShift. Here, the key takeaway is that Operators are the primary pattern for expressing and automating operational expertise as Kubernetes‑native software.

Views: 11

Comments

Please login to add a comment.

Don't have an account? Register now!