Command Palette

Search for a command to run...

Назад к скиллам
скилл № 14747

devops-kubernetes-operators

Use when the user asks about Kubernetes operators, custom controllers, CRDs, Kubebuilder, Operator SDK, controller-runtime reconcile loops, finalizers…

БесплатноБез исполняемых скриптов
j4flmaoот j4flmao★ 47 звёзд на GitHub

Установить devops-kubernetes-operators в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Об этом скилле

Kubernetes Operators

Purpose

Build Kubernetes operators and custom controllers using Kubebuilder, Operator SDK, or raw controller-runtime to automate application management on Kubernetes. Covers CRD design, reconciliation loops, finalizers, webhooks, testing, and deployment.

Agent Protocol

Trigger

Exact user phrases: "Kubernetes operator", "operator", "custom controller", "Kubebuilder", "Operator SDK", "CRD", "Custom Resource Definition", "reconciliation loop", "reconcile", "controller-runtime", "finalizer", "admission webhook", "conversion webhook", "multi-version CRD", "envtest", "OLM", "Operator Lifecycle Manager", "operator pattern".

Input Context

  • Go programming experience level
  • Kubernetes version targeted
  • Operation to automate (backup, deploy, configure, clean up)
  • Existing CRD structures (if any)
  • Testing framework preference
  • Deployment strategy (OLM, Helm, raw manifests)

Output Artifact

Kubebuilder project scaffold, CRD type definitions, controller implementation (Go), webhook configuration, test files, and deployment manifests.

Response Format

Go code, YAML manifests, and Makefile targets. No preamble. No postamble. No filler.

Completion Criteria

  • CRD types defined with validation markers
  • Controller reconcile loop implemented
  • Status subresource updated with observed state
  • Finalizers for resource cleanup (if needed)
  • Webhooks configured (validating/mutating, if needed)
  • Tests pass (unit + envtest integration)
  • RBAC manifests correct and scoped
  • Deployment via OLM or Helm configured

Architecture / Decision Trees

When to Build an Operator

What are you managing?
  Application lifecycle (deploy, upgrade, backup) → Consider operator
  Single resource creation → Helm chart + ArgoCD (simpler)
  Multi-step orchestration across resources → Operator pattern

  Is the logic simple (create/delete static resources)?
    YES → Helm + lifecycle hooks
    NO → Operator (dynamic decision making needed)

  Do you need to respond to external events?
    YES → Operator (watch external state, reconcile)
    NO → Helm (static deployment)

  Do you need to manage stateful applications?
    YES → Operator (backup, restore, scale up/down, failover)
    NO → Helm + Kubernetes primitives

  Is your team comfortable with Go?
    YES → Kubebuilder (most features, best performance)
    NO → Python operator (kopf), Ansible operator, or Java (java-operator-sdk)

Operator Implementation Comparison

Approach Language CRD Generation Testing Complexity Performance
Kubebuilder Go Built-in envtest Medium Best
Operator SDK (Go) Go Built-in envtest Medium Best
Operator SDK (Ansible) Ansible Manual Molecule Low Moderate
Operator SDK (Helm) Helm Manual Limited Low Moderate
Kopf Python Manual pytest Low Moderate
Java Operator SDK Java Manual JUnit Medium Good
Metacontroller JS (Lambda) Manual Custom Low Good

Core Workflow

Step 1: Project Scaffold with Kubebuilder

# Install Kubebuilder
curl -L -o kubebuilder https://go.kubebuilder.io/dl/latest/$(go env GOOS)/$(go env GOARCH)
chmod +x kubebuilder && sudo mv kubebuilder /usr/local/bin/

# Scaffold project
kubebuilder init --domain example.com --repo github.com/org/my-operator
kubebuilder create api --group batch --version v1 --kind BackupJob --resource=true --controller=true

# Project structure
# my-operator/
# ├── api/
# │   └── v1/
# │       ├── backupjob_types.go      # CRD type definitions
# │       ├── backupjob_webhook.go    # Optional webhooks
# │       ├── groupversion_info.go
# │       └── zz_generated.deepcopy.go
# ├── cmd/
# │   └── main.go                     # Entry point
# ├── config/
# │   ├── crd/                        # Generated CRD YAML
# │   ├── rbac/                       # RBAC manifests
# │   ├── manager/                    # Controller deployment
# │   ├── samples/                    # Example CRs
# │   └── webhook/                    # Webhook configuration
# ├── internal/
# │   └── controller/
# │       └── backupjob_controller.go # Reconciliation logic
# ├── Dockerfile
# ├── Makefile
# └── go.mod

Step 2: CRD Type Definitions

// api/v1/backupjob_types.go
package v1

import (
    metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

// BackupJobSpec defines the desired state
type BackupJobSpec struct {
    // Source defines the data source for backup
    // +kubebuilder:validation:Required
    Source BackupSource `json:"source"`

    // Destination defines where backup is stored
    // +kubebuilder:validation:Required
    Destination BackupDestination `json:"destination"`

    // Schedule in cron format (optional, for recurring backups)
    // +optional
    Schedule string `json:"schedule,omitempty"`

    // Retention policy in days
    // +kubeb
Полный SKILL.md на GitHub

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

  • references/controller-runtime.md
  • references/finalizers-garbage.md
  • references/kubernetes-operators-advanced.md
  • references/kubernetes-operators-fundamentals.md
  • references/kubernetes-operators.md
  • references/merged-cloud-native-k8s-operators.md
  • references/operator-lifecycle-management.md
  • references/operator-patterns.md
  • references/operator-performance-scaling.md
  • references/operator-sdk-guide.md
  • references/testing-operators.md

FAQ

Что делает скилл devops-kubernetes-operators?

Use when the user asks about Kubernetes operators, custom controllers, CRDs, Kubebuilder, Operator SDK, controller-runtime reconcile loops, finalizers, conversion webhooks, envtest, OLM, or Crossplane compositions. Produces operator code and CRD designs. Not for a chart plus operator scaffold (use cloud-native-kubernetes-mastery).

Как установить скилл devops-kubernetes-operators?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл devops-kubernetes-operators запускает скрипты?

Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.

Похожие скиллы

Сравнить devops-kubernetes-operators с