Kubernetes Operator

Use when building a Kubernetes Operator — custom controllers that reconcile CRD state.

Development / Engineeringdevelopmentengineering
by AgentVoltv1.0.0Published 1y ago1 install
Free to sign up · every skill included with AgentVolt Pro

Before & after

Same prompt, same agent — the only difference is the skill.

PromptBuild an operator that reconciles database backup CRDs into cloud storage
Beforegeneric AI agent
Building a Kubernetes operator is a complex task. You'll need to understand the operator pattern and how custom resources work. You should start by defining your Custom Resource Definition that describes what you want to manage. Then you'll need to build a controller that watches for changes to your CRD and takes action. The controller logic needs to reconcile the desired state with the actual state in your cluster. You'll probably want to use a framework like Operator SDK or Kubebuilder to help with the scaffolding. Testing your operator thoroughly is important. You should also think about logging, error handling, and edge cases. Would you like guidance on any particular part of the operator development process?
Afterwith Kubernetes Operator
OPERATOR SCAFFOLD: DatabaseBackup CRD to Cloud Storage

CRD DEFINITION
  apiVersion: storage.example.com/v1
  kind: DatabaseBackup
  metadata: name: prod-postgres-daily
  spec:
    database: postgresql-prod
    schedule: 0 2 * * * (2 AM daily)
    destination: s3://backups/prod-db
    retention: 30 (days)
    compressionFormat: gzip

RECONCILE LOOP FLOW
  Watch event: DatabaseBackup created/updated
  Fetch current: Is backup job running? Last backup timestamp?
  Desired state: According to spec, when is next backup due?
  Action: If due, create Kubernetes Job manifest
  Job: Runs pg_dump, uploads to S3, updates status.lastBackupTime
  Status patch: DatabaseBackup shows lastBackupTime, nextBackupTime, backupSize
  Cleanup: Delete completed Job after 24 hours
  Error handling: Set status Failed, trigger alert if backup fails

VALIDATION & LINTING
  CRD validator: Checks cron syntax, retention positive, path valid
  Reconcile linter: Detects loops, missing Owner References
  Test suite: Unit tests for state transitions, integration with fake apiserver

CAPABILITY LEVEL AUDIT
  Level 1: Install and auto-backup (reconcile complete)
  Level 2: Restore from backup (secondary RestoreRequest CRD controller)
  Level 3: Multi-region failover (replica destinations in spec)
  Current: Level 1. Roadmap: Level 2 next release

DEPLOYMENT
  Controller image: backup-operator:v1.0.0
  RBAC: ClusterRole for core/jobs, storage.example.com/backups
  Usage: kubectl apply -f DatabaseBackup.yaml

About this skill


name: kubernetes-operator description: Use when Use when building a Kubernetes Operator — custom controllers that reconcile CRD state.

Kubernetes Operator

Use when building a Kubernetes Operator — custom controllers that reconcile CRD state. Triggers on "build an operator", "CRD design", "reconcile loop", "controller-runtime", "kubebuilder", "operator-sdk", "metacontroller", "KOPF", "operator capability levels", or "custom resource". Ships CRD validator, reconcile-loop linter, and OperatorHub capability auditor (all stdlib Python), 4 references on the operator pattern + CRD design + reconcile patterns + tooling landscape, and a /operator-audit slash command. NOT a generic k8s skill — specifically the Operator pattern.

What you get

  • Public GitHub repo (alirezarezvani/claude-skills)
  • the kubernetes-operator skill folder with SKILL.md. Part of a 337-skill / 30-agent / 70-command install.

Customize your output

  • Fork the repo and adapt the skill's instructions and references to your workflow.

Example output

Activates automatically when your request matches Kubernetes Operator; chains with the other skills, agents, and commands in the collection.

Best for

Creators, builders, and teams using Claude Code.

SKILL.md preview

SKILL.md
---
name: kubernetes-operator
description: Use this skill when building a Kubernetes Operator — a custom controller that reconciles custom resource state — rather than general Kubernetes configuration work.
version: 1.0.0
category: Development / Engineering
author: AgentVolt
license: proprietary
tags:
  - development
  - engineering
---

# Kubernetes Operator

Builds Kubernetes Operators specifically — custom controllers with reconcile loops managing custom resource definitions — not general cluster configuration or manifest authoring.

## When to use

… (sign up to view the full skill)
Sign up to view, copy, and install the full skill

More development skills

View all Development skills →