Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

kubernetes-operator

БесплатноЗапускает вложенные скриптыНе проверен

Design, build, and operate Kubernetes operators. Use when extending Kubernetes with a custom controller, choosing a framework, designing CRDs, implementing…

borgheiот borghei★ 1 250 звёзд на GitHub

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

Kubernetes Operator

End-to-end Kubernetes operator design and construction. Covers the operator pattern (control loops for stateful workloads), CRD design (schema, validation, conversion, status), the reconciliation loop (idempotency, convergence, level- vs edge-triggered), framework selection (controller-runtime / Kubebuilder / operator-SDK / metacontroller), and operational concerns (finalizers, leader election, RBAC scoping, status subresource, observability). Targets Go-based operators (the dominant ecosystem) with notes on alternatives (KOPF, JOSDK, kube-rs).

Core Capabilities

  • Decide whether to write an operator — operator vs Helm vs GitOps vs admission webhook vs Crossplane, and when NOT to build one at all.
  • CRD design — spec/status separation, OpenAPI v3 structural schemas, CEL cross-field validation, versioning, conversion webhooks, status subresource, printer columns, scale subresource.
  • Reconciliation loops — idempotent, level-triggered, converging control loops; phase machines vs always-converge; owner references and garbage collection.
  • Controller-runtime patterns (Go) — skeleton reconcilers, server-side apply, finalizers, leader election, watches/predicates/indexers, error classification, envtest.
  • Framework selection — controller-runtime, Kubebuilder, operator-SDK, Metacontroller, KOPF, JOSDK, kube-rs.
  • Operational hardening — finalizers, leader election, tightened RBAC, status conditions/observedGeneration, Prometheus metrics + structured logging.
  • Anti-pattern audit — 24-entry catalog with severities, detection heuristics, and fixes for production-readiness review.

When to Use

Situation Skill applies
Building a new operator for an internal platform primitive Yes — start with the operator pattern decision
Auditing an existing operator for production-readiness Yes — use anti-patterns + scripts/reconciliation_audit.py
Designing CRDs for a custom resource Yes — use CRD design + scripts/crd_validator.py
Deciding "operator vs Helm chart vs plain manifests" Yes — use the decision matrix
Scaffolding a new operator project Yes — scripts/operator_scaffold.py
Debugging a controller that "isn't reconciling" Yes — use reconciliation troubleshooting
Just running someone else's operator (Postgres, Kafka, etc.) Partially — useful for understanding what it does and how to monitor it

Clarify First

Before scaffolding or auditing, settle the inputs below. When one is missing or vague and would change the result, ask about it; when it wouldn't, use a sensible default and say which one you used.

  • Task: scaffold an operator, validate a CRD, or audit a controller (selects operator_scaffold.py vs crd_validator.py vs reconciliation_audit.py).
  • Resource identity: for scaffolding: the operator name, API group, and kind (sets --name/--group/--kind); for validation/audit: the CRD YAML or controller path (the input the scripts read).
  • Framework: controller-runtime/Kubebuilder/operator-SDK (Go), or KOPF/JOSDK/kube-rs (drives the scaffold patterns).

Ask about the two or three inputs that matter most for this request, not the whole list. If the user wants a result straight away, produce it and state your assumptions at the top.

Workflow

  1. Decide whether to build one. Use the decision matrix in references/operator-decisions-and-workflows.md; a Helm chart, GitOps or an admission policy is often enough.
  2. Design the CRD (spec/status split, structural schema, CEL rules, status subresource, printer columns) and check it with crd_validator.py.
  3. Scaffold with operator_scaffold.py, then go mod tidy (resolves current controller-runtime and k8s.io versions) and make generate manifests build (controller-gen writes DeepCopy methods, CRDs and RBAC). Kubebuilder (kubebuilder init / create api) is the fuller alternative when you want its project layout, webhooks and test harness.
  4. Implement the reconciler: idempotent, level-triggered, owner references on children, finalizers for external resources, observedGeneration and conditions in status.
  5. Audit with reconciliation_audit.py against the controller source and CRDs; fix every critical finding.
  6. Verify with envtest or a kind cluster: create, update and delete the resource; kill the controller mid-reconcile and confirm it converges; run two replicas with leader election on.

Quick Start

python3 scripts/crd_validator.py --schema assets/sample_crd_weak.yaml                            # no status subresource, untyped spec (exit 1)
python3 scripts/reconciliation_audit.py --controller-path assets --crd assets/sample_crd_weak.yaml  # missing finalizer/ownerRef, wildcard RBAC ... (exit 1)
python3 scripts/operator_scaffold.py --name db-operator --group example.com --kind Database --out "$(mktemp -d)/db-
Полный SKILL.md на GitHub

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

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

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

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

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

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

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

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

assets/sample_controller_flawed.goassets/sample_crd_weak.yamlreferences/controller-runtime-patterns.mdreferences/operator-anti-patterns.mdreferences/operator-decisions-and-workflows.mdreferences/operator-pattern-and-crds.mdscripts/crd_validator.pyscripts/operator_scaffold.pyscripts/reconciliation_audit.py

FAQ

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

Design, build, and operate Kubernetes operators. Use when extending Kubernetes with a custom controller, choosing a framework, designing CRDs, implementing reconciliation loops, or auditing an operator for anti-patterns.

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

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

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

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

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

Сравнить kubernetes-operator с