kubernetes-operator

kubernetes-operator is a skill for Claude Code, Codex from tmj-90/gaffer. It costs 74 tokens per session (1,605 once invoked), scanned A, original, Apache-2.0.

Guidance for building a Kubernetes Operator, a controller that repeatedly makes a cluster match the desired configuration in a custom resource. It focuses on reconciliation, cleanup, retries, status, and permissions.

In plain words
What is it for?
Designing custom resources and reconcile loops, and building Operators with tools such as controller-runtime, Kubebuilder, or Operator SDK.
Why use it?
It helps avoid common controller errors such as missing cleanup steps, stalled retries, incorrect status updates, and excessive access rights.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one.

Good fit Designing custom resources and reconcile loops, and building Operators with tools such as controller-runtime, Kubebuilder, or Operator SDK.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/tmj-90/gaffer/kubernetes-operator
Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

Any agent
npx skills add tmj-90/gaffer --skill kubernetes-operator
Clone the repo
git clone --depth 1 https://github.com/tmj-90/gaffer

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for kubernetes-operator

README.md
[![agentmods](https://agentmods.dev/badge/skills/tmj-90/gaffer/kubernetes-operator/github.svg)](https://agentmods.dev/skills/tmj-90/gaffer/kubernetes-operator)
Your own site
<a href="https://agentmods.dev/skills/tmj-90/gaffer/kubernetes-operator"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/kubernetes-operator/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for kubernetes-operator

Your own site · 80×15
<a href="https://agentmods.dev/skills/tmj-90/gaffer/kubernetes-operator"><img src="https://agentmods.dev/badge/skills/tmj-90/gaffer/kubernetes-operator.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 74 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,605 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00074 $0.01605
Opus 5.5 $0.00030 $0.00642
Sonnet 5.5 $0.00015 $0.00321
Haiku 4.5 $0.00007 $0.00161

Measured 1mo ago against content hash 894ae456fb1a, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

kubernetes-operator scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

runner/skills/kubernetes-operator/SKILL.md · 109 lines

How it starts

The opening of the file, as written. The whole thing — 109 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Build operators that reconcile correctly

An operator is a level-based control loop: each Reconcile reads the whole current state, computes what should exist, converges one step, and records what it observed. Most operator bugs are distributed-systems bugs — stale caches, conflicting writers, a paused leader — not Kubernetes API bugs. Sources: the Kubernetes API conventions, the kubebuilder book's "Good practices", and the controller-runtime FAQ.

Invariants

  • Idempotent and level-based. Reconcile must produce the same result however many times it runs and must not branch on "was this a create or an update event" — events are coalesced and dropped. Read all needed state, then write.
  • One controller per Kind. Children map back to their root via Owns(...) / handler.EnqueueRequestForOwner; other Kinds via EnqueueRequestsFromMapFunc.
  • Spec is the user's, status is yours. Enable the status subresource (+kubebuilder:subresource:status), write status only through it, and report metav1.Conditions (Type, Status, Reason, Message, ObservedGeneration) plus status.observedGeneration.
  • Assume the cache is stale. Use deterministic child names so a duplicate create fails with AlreadyExists instead of creating two.
  • Writes are optimistic. Every update carries a resourceVersion; a Conflict means someone else wrote — return the error and let the requeue re-read. Never retry by blindly re-applying your stale copy. Prefer Patch (merge-from) or server-side apply with a field owner for children.

Procedure

  1. Read what exists. search_lore for framework, CRD group/version conventions and RBAC policy. Match the existing toolchain (kubebuilder, operator-sdk, KOPF). Target OLM capability level 1 (basic install) first; promote only when lower levels are tested.
  2. Design the API. Minimal spec; validation in the schema (kubebuilder markers, CEL x-kubernetes-validations) before reaching for a webhook; defaults via markers; status with conditions such as Ready/Degraded. Version the API (v1alpha1) and never repurpose a field.
  3. Implement Reconcile in this order: get the object (not found → return nil); handle DeletionTimestamp (run cleanup, remove finalizer, return); ensure finalizer (only if you own resources outside the cluster or across namespaces — otherwise owner references + garbage collection suffice); converge each child with controllerutil.SetControllerReference; update status; return.
  4. Return values mean something. Transient error → return ctrl.Result{}, err (rate-limited backoff). Waiting on something external → RequeueAfter. Invalid spec the user must fix → set a condition and return without error (or reconcile.TerminalError) so it does not hot-loop. Every external call takes the request ctx with a timeout. Do not hand work to a goroutine Reconcile never observes — its error is lost and nothing requeues; start long external work idempotently and poll it with RequeueAfter.
  5. Concurrency and leadership. The workqueue never processes the same key concurrently, but different keys run in parallel under MaxConcurrentReconciles — state shared across keys (in-memory maps, external quotas) needs synchronisation. Enable leader election for >1 replica and keep the default "exit on lost lease". A leader paused past its lease (GC, SIGSTOP, node freeze) may resume and write before it notices: resourceVersion conflicts fence Kubernetes writes, but external side effects need idempotency keys or their own fencing. Live runs lost acknowledged writes to exactly this time-only lease pattern.
  6. Avoid self-triggered loops. Use predicate.GenerationChangedPredicate on the primary resource when status updates should not re-trigger reconciliation; never write status fields that change every run (timestamps) without a real change.
  7. RBAC and manifests. +kubebuilder:rbac markers with the narrowest verbs and resources; no wildcards; namespace-scoped Role unless cluster scope is required and documented. Regenerate (see Verification) and commit generated files; never hand-edit them.
  8. Verify (below), evidence each acceptance criterion with the record-evidence skill, then stop.

Read the full file on GitHub · 109 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago Changed · +40 lines 894ae456fb1a
  2. 2mo ago First seen · 69 lines · 74 tokens per session scan A 3cc7256722f7

Subscribe to this mod's changes

kubernetes-operator is a skill published in the GitHub repository tmj-90/gaffer (2 stars, last pushed 2d ago), licensed Apache-2.0. It adds 74 tokens to every session and 1,605 once invoked, about $0.0003 per session on Opus 5.5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

kubernetes-operator compared with skills from other repositories

kubernetes-operator next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
kubernetes-operatortmj-90/gafferSkill22d agoApache-2.0A74Claude Code, Codex
plan-creationQBall-Inc/the-bulwarkSkill8yesterdayMITA38Claude Code
bulwark-brainstormQBall-Inc/the-bulwarkSkill8yesterdayMITA50Claude Code
test-auditQBall-Inc/the-bulwarkSkill8yesterdayMITA0Claude Code
anthropic-validatorQBall-Inc/the-bulwarkSkill8yesterdayMITA40Claude Code
code-reviewQBall-Inc/the-bulwarkSkill8yesterdayMITA61Claude Code
create-subagentQBall-Inc/the-bulwarkSkill8yesterdayMITA42Claude Code