Kubernetes Operator Developmentのロゴ

Kubernetes Operator Development

コミュニティ
d-padmanabhan
kubernetes-operator-development

Designs, implements, reviews, tests, and operates Kubernetes operators and controllers in Go with Kubebuilder and controller-runtime. Use when defining CRDs, reconciliation loops, status conditions, finalizers, admission webhooks, external-provider controllers, operator upgrades, envtest suites, or controller-runtime cache, retry, and concurrency behavior.

概要

公開者d-padmanabhan
リポジトリagent-engineering-handbook
スキル名kubernetes-operator-development
スター
20
フォーク
3
同梱ファイル
5
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 5個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    d-padmanabhanがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルKubernetes Operator DevelopmentをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/kubernetes-operator-development
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/d-padmanabhan/agent-engineering-handbook.git /tmp/agent-engineering-handbook
mkdir -p .claude/skills
cp -r /tmp/agent-engineering-handbook/skills/kubernetes-operator-development .claude/skills/kubernetes-operator-development
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでKubernetes Operator Developmentを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にKubernetes Operator Developmentを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Kubernetes Operator Developmentは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Kubernetes Operator Development

Mandatory controller and cluster-mutation gates live in the Kubernetes rule (${HANDBOOK_ROOT}/rules/450-kubernetes.mdc). This skill owns the operator design and implementation workflow. Use the Kubernetes containers skill (${HANDBOOK_ROOT}/skills/kubernetes-containers/SKILL.md) for workloads, Helm, Argo CD, and cluster operations.

Core Contract

A custom resource expresses desired intent. Reconciliation observes desired and actual state, performs retry-safe work, and records what was observed. Events only indicate that state might have changed; they are not durable exactly-once commands.

Every design must answer:

  • What is authoritative, and which fields does this controller own?
  • How is each external resource identified and ownership-verified?
  • What happens after duplicate delivery, restart, timeout, or lost response?
  • What is safe to create, adopt, update, retain, and delete?
  • What makes each condition current for the resource generation?
  • What bounds retries, provider calls, concurrency, and tenant impact?
  • How are API and operator upgrades rolled forward and back?

Do not implement a one-shot provisioning workflow inside Reconcile.

Decide Whether to Build an Operator

Prefer an existing Kubernetes API, vendor operator, Crossplane provider, cloud service operator, or composition mechanism when it already provides the required ownership and lifecycle semantics.

Build a custom operator when continuous convergence, a domain-specific API, multi-resource ownership, or custom lifecycle policy creates clear platform value. Do not wrap a trivial remote API call merely to expose it as a CRD.

Design Before Coding

Complete the design review template (${HANDBOOK_ROOT}/skills/kubernetes-operator-development/references/design-review-template.md) before scaffolding implementation. Resolve:

  1. API intent, scope, maturity, and compatibility.
  2. Source of truth and field ownership.
  3. External identity, collision prevention, and adoption proof.
  4. finalizer, deletion, orphan, and recovery behavior.
  5. status conditions and readiness semantics.
  6. retry, rate-limit, timeout, and concurrency budgets.
  7. authentication, Kubernetes RBAC, and provider authorization.
  8. test, upgrade, observability, and rollback evidence.

Use Kubebuilder scaffolding unless repository constraints justify another framework. Verify current Kubebuilder, controller-runtime, Go, and Kubernetes compatibility from official release and support documentation. Do not copy version-specific snippets without checking the repository's pinned versions.

Reconciliation Workflow

Keep Reconcile as orchestration:

  1. Read the primary resource; ignore a true API NotFound.
  2. Handle deletion before normal reconciliation.
  3. Persist the finalizer before creating resources that require cleanup, then return or re-read before continuing.
  4. Validate runtime prerequisites not enforceable at admission.
  5. Observe actual state and verify ownership.
  6. Build desired state and calculate the owned-field delta.
  7. Apply at most the safe, bounded work justified by current observations.
  8. Update status through the status subresource with current conditions and observedGeneration.
  9. Return an error or explicit requeue only under the documented retry policy.

External creation must survive a successful provider mutation followed by a lost response. Prefer a provider idempotency key or conditional create tied to stable operation identity. Observe-before-create is useful but is not by itself race-safe.

Use stable provider identifiers plus verifiable ownership metadata such as the Kubernetes namespace, name, and UID. Status is operational state, not proof of ownership. A deleted and recreated CR has a new UID and must not silently inherit destructive authority over an old external resource.

Detailed runtime guidance: ${HANDBOOK_ROOT}/skills/kubernetes-operator-development/references/reconciliation-runtime.md.

Use controller-runtime's managed cache and event pipeline for normal operators. Declare primary, owned, and dependency watches through the builder, with indexes, mapping functions, and predicates where needed. Do not implement a raw Kubernetes Watch loop or copy a short global resync interval as a substitute for complete event sources and level-based convergence. Use client-go shared informers directly only for a documented lower-level need.

API and Lifecycle

  • Use apiextensions.k8s.io/v1 structural schemas and prune unknown fields.
  • Prefer OpenAPI defaults and validation, then CEL, then admission webhooks only when schema mechanisms cannot express the policy.
  • Model lists and maps with explicit merge semantics where field ownership or Server-Side Apply depends on them.
  • Use metav1.Condition; condition types are positive summaries, reasons are stable machine-readable identifiers, and messages are safe human context.
  • Make destructive deletion and adoption explicit, authorized, auditable, and ownership-checked. Conservative defaults are required for durable data.
  • Treat conversion, storage-version migration, default changes, and rollback as one upgrade contract.

Detailed API guidance: ${HANDBOOK_ROOT}/skills/kubernetes-operator-development/references/api-lifecycle.md.

Provider and Security Boundaries

  • Prefer workload identity. Keep raw credentials outside model, CR spec, status, logs, events, and metrics.
  • Grant Kubernetes and provider permissions per resource and action; avoid wildcard access.
  • Validate provider destinations and identifiers. User-controlled endpoints require scheme, host, redirect, DNS, address, timeout, and response-size controls.
  • Reuse bounded provider clients and transports. Coordinate controller, provider SDK, and HTTP retry layers so delays do not multiply.
  • Apply global and per-tenant concurrency and rate limits. A noisy tenant must not consume the entire controller or provider budget.
  • Do not force Server-Side Apply ownership over fields managed by humans or other controllers.

Use the workload identity, service resilience, observability, security testing, and Go systems skills for their canonical cross-cutting workflows.

Verification

Test at the smallest layer that proves the behavior:

  • unit tests for desired-state construction, diffs, classification, and provider translation;
  • API-server or envtest tests for schema, status, finalizers, watches, indexes, conflicts, and reconciliation;
  • provider contract tests for idempotency, lost responses, throttling, eventual consistency, and ownership checks;
  • upgrade tests for served and storage versions, conversion, changed defaults, rollback, and existing objects;
  • end-to-end tests for create, drift, partial failure, restart, deletion, retention, adoption, and orphan recovery.

Fake clients do not prove API-server behavior. envtest does not run every Kubernetes controller, so garbage collection and other control-plane behavior need explicit substitutes or real-cluster tests.

Run repository generation, formatting, lint, race, vulnerability, manifest, schema, and test commands. Confirm generated code and manifests are current and inspect their diff. See the testing and operations reference (${HANDBOOK_ROOT}/skills/kubernetes-operator-development/references/testing-operations.md).

Review Output

Lead with correctness and data-loss risks. Report:

  1. API and ownership contract.
  2. Reconciliation safety under retry, concurrency, and partial failure.
  3. Deletion, adoption, and upgrade hazards.
  4. Security, scale, and operability gaps.
  5. Exact verification evidence and remaining limitations.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Kubernetes Operator Development」では何ができますか?

Designs, implements, reviews, tests, and operates Kubernetes operators and controllers in Go with Kubebuilder and controller-runtime. Use when defining CRDs, reconciliation loops, status conditions, finalizers, admission webhooks, external-provider controllers, operator upgrades, envtest suites, or controller-runtime cache, retry, and concurrency behavior.

TypingMindでKubernetes Operator Developmentを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Kubernetes Operator Developmentはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにKubernetes Operator Developmentをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/d-padmanabhan/agent-engineering-handbook/tree/main/skills/kubernetes-operator-developmentを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Kubernetes Operator Developmentを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Kubernetes Operator Developmentは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもKubernetes Operator Developmentを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Kubernetes Operator Development」は無料ですか?

はい。d-padmanabhanがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇