Overrides

2 min read

spec.crds in a Komposer is not for defining new operators — it is for environment-specific tuning on top of imported definitions. It uses the same field structure as a Katalog spec.crds entry, but any field you set here wins over the imported value.


What can be overridden

Every field on a CRD entry can be overridden. You only need to declare the fields you want to change — everything else is inherited from the import source.

spec:
  crds:
    # Override the postgres pattern for production
    postgres:
      workers: 8       # default from import: 2
      resync: 30s      # default from import: 1m

    # Override the website operator
    website:
      workers: 6
      resync: 15s

    # Disable an operator entirely
    database:
      enabled: false

The postgres, website, and database CRD names must have been declared in an import source. If a name in spec.crds does not match any import, it is a validation error.


Common override fields

FieldTypeDescription
enabledboolfalse suppresses the operator without removing the import.
workersintNumber of reconcile worker goroutines.
resyncdurationForced resync interval (e.g. 30s, 5m).
finalizerslistAdditional finalizers applied to all CRs of this kind.

Any field valid in a Katalog CRD entry is valid here. Override only what differs between environments — leave the rest to the import source.


Resolution order

1. imports.registry   — pulled first
2. imports.files      — loaded next
3. imports.helm       — rendered next
4. spec.crds          — wins on every field it declares

This means a production Komposer can import a staging Katalog from the registry and tighten its settings via spec.crds without modifying the upstream definition.


Conflict rules

SituationResult
Same CRD name in two import sourcesHard error — duplicate CRD names across imports are not allowed.
CRD name in spec.crds not in any importValidation error — spec.crds is for overrides only.
Same field in import and spec.crdsspec.crds wins.
Same field in two importsHard error — resolve by disabling one import or moving to spec.crds.

Real example — 08-komposer-registry

# examples/advanced/08-komposer-registry/komposer.yaml

imports:
  registry:
    - url: ghcr.io/orkspace/patterns/[email protected]
      oci: true

  files:
    - ./website-katalog.yaml

  helm:
    - repo: https://github.com/orkspace/charts.git
      chart: orkestra-katalog-example
      version: v0.1.0

spec:
  crds:
    postgres:
      workers: 8
      resync: 30s

    website:
      workers: 6
      resync: 15s

    database:
      enabled: false

Try it:

ork init --pack advanced
cd advanced/08-komposer-registry
ork run -f komposer.yaml