Skip to content

Commit 684461e

Browse files
Ca-moesclaude
andcommitted
docs(architecture): tier-2 operator CRs + the CR-translation layer
Update the tier-2 description (config-driven fieldMaps + CNPG/OTel built-ins) and document the match-rule translation: recommenders report the operator-generated workload, not the CR, so rere rewrites that identity to the owning CR before discovery. Note the FieldMapper now exposes ResolvePath and the editor is path-addressed. Validated: docs-framework v0.7.1 -> 13 docs, 0 issues. Part of #7. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 3292dab commit 684461e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎docs/explanation/architecture.md‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,12 @@ A thin **cli** layer (cobra, [ADR-0005](../adrs/0005-cobra-cli-framework.md)) or
4444
## The three field-map tiers
4545

4646
- **Tier 1** raw Deployment/StatefulSet/DaemonSet → PodSpec path `spec.template.spec.containers[name==X].resources`, **inferred, zero-config**.
47-
- **Tier 2** operator CR → **config-driven** with **built-in maps** (e.g. CNPG `Cluster`, OpenTelemetryCollector). CRD-schema auto-discovery is deferred.
47+
- **Tier 2** operator CR → **config-driven** field maps (`fieldMaps` in config) with **built-ins** for CNPG `Cluster` and `OpenTelemetryCollector` (both `spec.resources`), user-extensible. CRD-schema auto-discovery is deferred.
4848
- **Tier 3** HelmRelease `values:` → **per-chart config** with built-in maps for common charts, so most repos need none.
4949

50-
`FieldMapper` is one interface; later tiers slot in without touching callers.
50+
`FieldMapper` is one interface (`Supports` / `ResolvePath` / `Resolve`); the run loop selects the first mapper that supports a manifest and edits the path it resolves, so later tiers slot in without touching callers. The editor (`yamledit`) is path-addressed and knows nothing about kinds.
51+
52+
**Operator-CR translation.** Recommenders report the operator-*generated* workload — KRR sees the Deployment `otel-collector`, or a CNPG instance Pod `mycluster-1`, not the `OpenTelemetryCollector`/`Cluster` CR that lives in the repo. Each tier-2 map carries a **match rule** (workload kind + name suffix/pattern + container→component) that rewrites the reported identity to the owning CR before discovery, collapsing instance pods into a single CR (one PR). The built-in match rules are best-effort pending a real `krr -f json` sample from those operators.
5153

5254
## Scope
5355

0 commit comments

Comments
 (0)