ork generate katalog

2 min read

Scaffold a starter katalog.yaml for a new operator.

ork generate katalog [flags]

Generates a katalog.yaml with sensible defaults, commented optional blocks, and TODO placeholders. All generated fields are valid YAML — no further tooling is required before editing.


Flags

FlagDescription
--add-hookTyped mode: include a commented hooks declaration
--add-constructorTyped mode: include a commented constructor declaration with default: false
--typedTyped mode: include both hooks and constructor sections commented; prints a warning
--add-securityInclude a security block (namespace and deletion protection)
--add-notificationInclude a notification block with example team entries
--add-provider <cloud>Include a providers block for aws, azure, or gcp
-o, --output <file>Output file path (default: katalog.yaml)

Reconcile Modes

Choose at most one reconcile mode flag. They are mutually exclusive.

FlagModeDescription
(none)DynamicDeclarative templates (onCreate, onReconcile, onDelete). No Go code needed.
--add-hookTypedCommented hooks declaration. You write a ReconcileHooks[*MyKind] factory in Go.
--add-constructorTypedCommented constructor declaration with default: false. You own the full reconcile loop.
--typedTypedBoth hooks and constructor sections commented. A warning is printed — you must uncomment exactly one before running.

Usage

Scaffold a dynamic-mode Katalog (default):

ork generate katalog

Typed mode with hooks:

ork generate katalog --add-hook -o database-katalog.yaml

Typed mode with a custom constructor:

ork generate katalog --add-constructor -o reconciler-katalog.yaml

Full typed mode (both sections commented, choose one):

ork generate katalog --typed

Add optional blocks:

ork generate katalog --add-security --add-notification --add-provider aws

Combine mode and optional flags:

ork generate katalog --add-hook --add-security --add-provider gcp -o ops-katalog.yaml

Behavior

  • Validates flag combinations before writing any file. Mutually exclusive flags produce a clear error.
  • Writes the scaffold to katalog.yaml (or --output path).
  • The output is pure YAML — no template syntax leaks into the generated file.
  • When --typed is used, a warning is printed to stderr reminding you to uncomment exactly one section.

Optional Blocks

Optional flags may be combined freely with any reconcile mode.

FlagBlock added
--add-securitysecurity.namespaceProtection and security.deletionProtection
--add-notificationnotification.teams with example Slack webhook entries
--add-provider awsproviders.aws with credential env-var placeholders
--add-provider azureproviders.azure with subscription and tenant env-var placeholders
--add-provider gcpproviders.gcp with project and credentials file placeholders

Notes

  • Replace every TODO placeholder before running ork run.
  • The generated file is idempotent — re-running overwrites the output file.
  • Provider names are case-insensitive (AWS, aws, and Aws all work).