tmforum-oda/oda-canvas/create-oda-operator
Claude Code and agent skill by tmforum-oda/oda-canvas
- community
Checking that the SKILL.md file is still in the repository.
Guide for creating Kubernetes operators for the ODA Canvas using the Python KOPF framework. Use this skill whenever you are building or modifying any Canvas operator, adding a kopf handler to existing code, creating a CRD watcher, implementing component lifecycle management, writing any Python Kubernetes controller, working with files in source/operators/, or answering questions like "how do I watch a CRD", "how do I update status", "how should I structure my operator chart", or "how do I add a health check to my operator". Also use for questions about operator peering, admission webhooks, timer/periodic handlers, or any kopf framework question.
Install
npx vskill@latest install tmforum-oda/oda-canvas/create-oda-operatorSKILL.md
Create ODA Operator
Technology
Most ODA Canvas operators use KOPF — Kubernetes Operators Framework for Python.
The Go-based operators (pdb-management/, oauth2EnvoyfilterOperator/) are outside this skill's scope.
Core dependencies (pinned versions used by this project):
Additional per-operator: cloudevents, jinja2, hvac (HashiCorp Vault), google-auth.
References:
- `references/kopf-docs.md` — curated kopf documentation links by topic
- `references/operator-catalog.md` — all existing operators with file paths and patterns
Quick Reference: Existing Operators
Before writing new code, check if an existing operator matches your use case:
| Use case | Reference operator | |
|---|---|---|
| Component/CRD lifecycle, sub-resource management | source/operators/TMFOP001-Component-Management/component-management/ | |
| API gateway integration (HTTPRoute, Kong plugins) | source/operators/TMFOP002-API-Management/kong/ | |
| Service mesh integration (VirtualService, EndpointSlice) | source/operators/TMFOP002-API-Management/istio/ | |
| External identity service integration + health timers | source/operators/TMFOP003-Identity-Config/keycloak/ | |
| Pod sidecar injection, admission webhooks | source/operators/TMFOP007-Secrets-Management/vault/ | |
| Cross-resource URL discovery, dependency resolution | source/operators/TMFOP005-Dependency-Management/simple-dependency-management/ | |
| Field-triggered handler, Kubernetes Secret creation | source/operators/TMFOP004-Credentials-Management/credentials-management/ |
See references/operator-catalog.md for kopf decorators used and detailed patterns in each.
Directory Structure
Operators are organised under source/operators/ in two-level directories.
Modern Pattern (Recommended)
For new operators, use a docker/ subdirectory with standard Dockerfile naming:
Example: source/operators/TMFOP005-Dependency-Management/simple-dependency-management/
Advantages:
- Follows standard Docker conventions (
Dockerfilewith capital D) - Clean separation of build context
- Supports multi-stage builds and test dockerfiles
- No need for explicit
buildDockerfilein workflow config
Legacy Pattern (Existing Operators)
Older operators use files in the operator root directory:
Examples: component-management/, kong/, keycloak/
Note: When maintaining legacy operators, keep the existing pattern for consistency. New operators should use the modern pattern.
The matching Helm chart lives at charts/<operator-chart-name>/.
Constants & Startup
Define CRD coordinates and HTTP codes at the top of every operator:
Always configure the watcher timeout in a startup hook to recover from stale watch connections:
Handler Patterns
Create / Resume / Update (triple-stacked)
The standard CRD lifecycle pattern — one function handles all three events. resume fires when the operator starts and finds pre-existing objects, ensuring continuity after restarts.
Docs: https://docs.kopf.dev/en/stable/handlers/
Delete Handlers
Kopf adds a finalizer so the object isn't fully deleted until this handler succeeds. Pass optional=True if the handler shouldn't block object deletion.
Field Handlers
React to specific field changes. Use a when= callback to conditionally filter to avoid re-processing unchanged states:
Docs: https://docs.kopf.dev/en/stable/filters/
Timer Handlers
Run periodically as long as the object exists — useful for health polling and reconciliation. idle waits for the resource to stabilise before first invocation:
Docs: https://docs.kopf.dev/en/stable/timers/
Health Check Probes
Expose a health endpoint Kubernetes liveness probes can call:
Docs: https://docs.kopf.dev/en/stable/probing/
Low-Level Event Watching
Watch raw watch-stream events without kopf storing handler state — useful for mirroring changes from another operator's CRDs or for lightweight reactive logic:
Docs: https://docs.kopf.dev/en/stable/handlers/#event-watching-handlers
Admission / Mutation Webhooks
Intercept resource creation/updates before they reach the cluster — the secretsmanagement operator uses this to inject a Vault sidecar into pods:
Requires a webhook server configured in startup. In-cluster, use a ServiceTunnel so Kubernetes calls back via the operator's Service DNS name. For simpler cases kopf can manage the webhook configuration automatically:
See source/operators/TMFOP007-Secrets-Management/vault/docker/ for the full ServiceTunnel implementation. Docs: https://docs.kopf.dev/en/stable/admission/
Sub-Handlers
Process a list of items with per-item kopf lifecycle (retries, status, logging):
Docs: https://docs.kopf.dev/en/stable/handlers/#sub-handlers
Error Handling
Three error categories — pick the right one to control retry behaviour:
Always handle ApiException explicitly when calling the Kubernetes client:
Docs: https://docs.kopf.dev/en/stable/errors/
Status Updates & Results Delivery
A handler's return value is automatically written to status.<handler_id>. Use a dict to store structured results:
Docs: https://docs.kopf.dev/en/stable/results/
Kubernetes API Calls
Docs: https://docs.kopf.dev/en/stable/idempotence/
Resource Hierarchies
Use kopf.adopt() to set ownerReferences on child resources so they are deleted with the parent (cascaded deletion):
Individual hierarchy helpers when you need fine-grained control:
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 95 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/create-oda-operator/SKILL.md
Popularity
- Repository stars
- 50
- Repository forks
- 67
- 7-day trend score
- 20
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 25 May 2026, 5 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/tmforum-oda/oda-canvas/create-oda-operator)