kubernetes-operator
Fungsinya
Skill ini memandu desain dan pemeriksaan operator Kubernetes, yaitu program yang mengelola resource kustom di dalam klaster. Cocok untuk insinyur yang membangun atau mengaudit controller semacam ini.
Kapan dipakai
- โSaat Anda sedang membangun operator Kubernetes baru untuk resource kustom.
- โSaat Anda ingin operator yang ada ditinjau dari finalizer yang hilang, status yang menyimpang, atau masalah izin.
- โSaat Anda perlu memilih framework seperti kubebuilder atau operator-sdk.
Link skill
https://github.com/alirezarezvani/claude-skills/blob/main/engineering/kubernetes-operator/skills/kubernetes-operator/SKILL.mdSalin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.
Cara pakai
Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.
Pesan siap tempel
Untuk Claude Code, Codex, atau Cursor: jalankan di folder proyek, lalu skill langsung terpasang.
Unduh SKILL.md lalu taruh di folder skill agen Anda.
Contoh permintaan ke AI
โSaya ingin membangun operator Kubernetes yang mengelola backup database kami. Bantu saya merancangnya sebelum saya menulis controller-nya.โ
5 skill baru setiap minggu. 1 menit baca.
Cara kerjanya
Agent memvalidasi definisi resource, memeriksa control loop untuk bug yang umum, dan menilai tingkat kematangan operator dengan skrip pembantu.
Konten teknis (SKILL.md asli)
Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.
Kubernetes Operator
Build operators that reconcile correctly. Most operator bugs are not Kubernetes bugs โ they are reconcile-loop bugs: missing finalizers, blocking calls, no requeue on transient errors, status drift, RBAC over-grants. This skill catches them deterministically before they reach a cluster.
When to use
- Building a new Kubernetes Operator (controller for a CRD)
- Reviewing an existing operator for capability-level gaps
- Auditing a CRD spec for status/conditions/finalizer correctness
- Choosing a framework (controller-runtime / kubebuilder / operator-sdk / metacontroller / KOPF)
- Designing the API surface of a Custom Resource
- Hardening RBAC, leader election, or webhook validation
When NOT to use
- Plain Helm chart packaging โ use
helm-chart-builder - Standard kubectl operations / blue-green deploys โ use
senior-devops - General k8s security posture โ use
cloud-security - "I want to run a workload" โ that's a Deployment / Job, not an operator
Core principle: an operator is a reconcile loop, not a script
observe(actual) โ desired = read(spec) โ diff(actual, desired) โ act โ update(status)
โ
requeue / done
Operators that fail are the ones that:
- Treat reconcile as imperative (do this, then this, then this) instead of declarative (make actual=desired, idempotently)
- Don't requeue transient failures
- Don't use finalizers, leaving orphan resources
- Mutate spec instead of status
- Don't use the status subresource (status updates trigger spec reconciles โ loop)
- Block in reconcile (long HTTP calls, locks)
- Forget leader election โ split-brain on multi-replica deploys
The 3 tools below catch each of these.
Quick start
SKILL=engineering/kubernetes-operator/skills/kubernetes-operator
# Validate a CRD design
python "$SKILL/scripts/crd_validator.py" --crd config/crd/myapp.yaml
# Lint a Go reconcile function
python "$SKILL/scripts/reconcile_lint.py" --controller controllers/myapp_controller.go
# Score against OperatorHub Capability Levels (1-5)
python "$SKILL/scripts/operator_capability_audit.py" --operator-dir .
The 3 Python tools
All stdlib-only. Run with --help.
crd_validator.py
Validates a CRD YAML against operator-pattern best practices.
python scripts/crd_validator.py --crd config/crd/myapp.yaml
python scripts/crd_validator.py --crd config/crd/ --format json
Checks:
spec.versions[*].subresources.statusis set (status subresource)spec.scopeisNamespaced(notCluster) unless explicitly justified- Singular and listKind defined
spec.versions[*].schema.openAPIV3Schemahas type definitions (nox-kubernetes-preserve-unknown-fields: trueat top level)- A version is marked
served: trueANDstorage: true - Conditions array is in the schema (allows
metav1.Conditions) - Printer columns include
AgeandStatus/Phase
reconcile_lint.py
Lints a Go controller reconcile function for anti-patterns.
python scripts/reconcile_lint.py --controller controllers/myapp_controller.go
Checks (regex-based heuristics):
- Returns are
(ctrl.Result, error)shape - Errors trigger a non-zero requeue (
return ctrl.Result{Requeue: true}, err) client.Update()on the spec object is flagged (controllers should update only status)time.Sleepinside reconcile is flagged (useRequeueAfter)- HTTP calls without context cancellation are flagged
- Missing
deferafter a finalizer add - No
IsConditionTrue/SetConditioncalls when conditions present in CRD - Reconcile function exceeds 80 lines (extract subroutines)
operator_capability_audit.py
Scores an operator against OperatorHub's 5 Capability Levels.
python scripts/operator_capability_audit.py --operator-dir .
Levels:
- L1 โ Basic Install: CRD defined, controller deploys it
- L2 โ Seamless Upgrades: PDBs, conversion webhooks, version skew strategy
- L3 โ Full Lifecycle: backups, restores, failure recovery
- L4 โ Deep Insights: metrics endpoint, Prometheus rules, alerts
- L5 โ Auto Pilot: auto-scaling, auto-tuning, anomaly detection
Reports current level + concrete next steps to advance one level.
Tooling landscape
Pick a framework based on language and complexity. See references/tooling_landscape.md.
| Framework | Language | Best for
Pertanyaan umum
Apa itu operator?
Itu adalah program yang mengawasi resource Kubernetes dan menjaga sistem sungguhan sesuai dengan yang dijelaskan resource tersebut.
Apakah ini untuk menjalankan aplikasi biasa?
Tidak. Aplikasi biasa berjalan sebagai Deployment atau Job, dan skill ini untuk membangun controller kustom.
Bug umum apa yang dicari?
Finalizer yang hilang, pemanggilan yang memblokir, tidak ada percobaan ulang untuk error sementara, status yang menyimpang, dan izin yang terlalu luas.
Detail
Deskripsi asli dari pembuat
Use when building a Kubernetes operator or CRD (controller-runtime, kubebuilder, operator-sdk, KOPF), before writing the controller. Validates CRDs with crd_validator.py, lints reconcile loops with reconcile_lint.py and scores OperatorHub capability level.
Popularitas
- Bintang GitHub
- 29k
- Peringkat
- #9564
- Lisensi
- MIT
- Diperbarui
- 2/11/2026
Komentar
- โฆ
Skill lain dari repositori ini
agent-launcher-orchestrator
29kMembantu agent Anda merencanakan, membangun, menguji, dan menjadwalkan agent Claude terkelola di akun Anda sendiri, langkah demi langkah.
grade-iterate
29kMembantu agent Anda menilai hasil kerja agent AI terkelola berdasarkan rubrik dan memperbaikinya dalam jumlah putaran tetap, agar tidak berputar tanpa henti.
interview
29kMembantu agent Anda mewawancarai Anda tentang ide agent AI dan mengubah jawaban Anda menjadi rencana pembangunan sederhana sebelum apa pun diluncurkan.
run-without-you
29kMembantu agent Anda disiapkan agar berjalan tanpa Anda sesuai jadwal atau saat sebuah peristiwa terjadi, dengan waktu cron diperiksa sebelum peluncuran.
Skill serupa
openclaw-update
394kMembantu agent Anda memperbarui OpenClaw Gateway yang sudah ada, dengan memilih metode pembaruan yang sesuai cara pemasangannya dan menjaga sesi Anda tetap berjalan.
diagnose-gateway
394kMembantu agent Anda mencari tahu mengapa OpenClaw Gateway gagal dengan memeriksa pengaturan, channel, dan port tanpa mengubah apa pun.
crabbox-apps
394kMembantu agent Anda membuka dan menjalankan aplikasi di mesin cloud sementara, lalu menampilkan tampilannya di panel samping chat Anda.