@intentius/chant-lexicon-k8s 0.99.0 → 0.101.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/dist/composites/catalog.d.ts.map +1 -1
  2. package/dist/composites/gke-otel-collector.d.ts.map +1 -1
  3. package/dist/composites/otel-collector-agent.d.ts +5 -1
  4. package/dist/composites/otel-collector-agent.d.ts.map +1 -1
  5. package/dist/composites/otel-collector-gateway.d.ts +37 -52
  6. package/dist/composites/otel-collector-gateway.d.ts.map +1 -1
  7. package/dist/composites/otel-collector-rbac.d.ts +74 -0
  8. package/dist/composites/otel-collector-rbac.d.ts.map +1 -0
  9. package/dist/composites/otel-collector-shape.d.ts +7 -0
  10. package/dist/composites/otel-collector-shape.d.ts.map +1 -1
  11. package/dist/composites/otel-collector.d.ts +8 -20
  12. package/dist/composites/otel-collector.d.ts.map +1 -1
  13. package/dist/import/live-export.d.ts +5 -0
  14. package/dist/import/live-export.d.ts.map +1 -1
  15. package/dist/integrity.json +4 -3
  16. package/dist/lint/audit-catalog.d.ts.map +1 -1
  17. package/dist/lint/post-synth/index.d.ts.map +1 -1
  18. package/dist/lint/post-synth/otel-placement-helpers.d.ts +5 -1
  19. package/dist/lint/post-synth/otel-placement-helpers.d.ts.map +1 -1
  20. package/dist/lint/post-synth/wk8604.d.ts +19 -0
  21. package/dist/lint/post-synth/wk8604.d.ts.map +1 -0
  22. package/dist/manifest.json +1 -1
  23. package/dist/okf/index.md +1 -0
  24. package/dist/okf/rules/WK8604.md +11 -0
  25. package/dist/rules/otel-placement-helpers.ts +7 -11
  26. package/dist/rules/wk8604.ts +29 -0
  27. package/package.json +3 -3
  28. package/src/composites/__snapshots__/gke-otel-collector.snapshot.test.ts.snap +2 -68
  29. package/src/composites/catalog.ts +6 -0
  30. package/src/composites/gke-otel-collector.snapshot.test.ts +3 -1
  31. package/src/composites/gke-otel-collector.ts +8 -2
  32. package/src/composites/otel-collector-agent.ts +6 -9
  33. package/src/composites/otel-collector-gateway.test.ts +102 -5
  34. package/src/composites/otel-collector-gateway.ts +96 -18
  35. package/src/composites/otel-collector-rbac.test.ts +114 -0
  36. package/src/composites/otel-collector-rbac.ts +144 -0
  37. package/src/composites/otel-collector-shape.ts +19 -0
  38. package/src/composites/otel-collector.ts +25 -34
  39. package/src/import/embedded-live.test.ts +138 -0
  40. package/src/import/live-export.ts +10 -2
  41. package/src/lint/audit-catalog.ts +1 -0
  42. package/src/lint/post-synth/index.ts +2 -0
  43. package/src/lint/post-synth/otel-placement-helpers.ts +7 -11
  44. package/src/lint/post-synth/otel-placement.test.ts +35 -0
  45. package/src/lint/post-synth/wk8604.ts +29 -0
@@ -1 +1 @@
1
- {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composites/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EAw5H5C,CAAC"}
1
+ {"version":3,"file":"catalog.d.ts","sourceRoot":"","sources":["../../src/composites/catalog.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAE/D,eAAO,MAAM,gBAAgB,EAAE,cAAc,EA85H5C,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"gke-otel-collector.d.ts","sourceRoot":"","sources":["../../src/composites/gke-otel-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAWH,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,MAAM,WAAW,qBAAqB;IACpC,wBAAwB;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,sBAAsB;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,q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IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,uDAAuD;IACvD,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,kDAAkD;IAClD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6CAA6C;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sDAAsD;IACtD,QAAQ,CAAC,EAAE;QACT,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,cAAc,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAClD,WAAW,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/C,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACtD,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9C,CAAC;CACH;AAED,MAAM,MAAM,sBAAsB,GAAG,uBAAuB,CAAC;AAE7D;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,gBAAgB,gGA0EP,CAAC"}
@@ -2,7 +2,8 @@
2
2
  * The Kubernetes resources an OpenTelemetry Collector agent needs, shared by
3
3
  * `OtelCollector` and `GkeOtelCollector`: a DaemonSet running the collector
4
4
  * with its config mounted from a ConfigMap, and a ServiceAccount bound to a
5
- * ClusterRole that reads pods, nodes and workloads.
5
+ * ClusterRole with the rules the caller works out from its config (see
6
+ * `agentClusterRules` in `otel-collector-rbac.ts`).
6
7
  *
7
8
  * The caller renders the collector config (with the otel lexicon's
8
9
  * `collectorYaml`) and says which ports the container exposes. Everything
@@ -13,6 +14,7 @@
13
14
  * (`collectorContainer`, `collectorConfigMap`) in a Deployment.
14
15
  */
15
16
  import { DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap } from "../generated/index.js";
17
+ import type { CollectorPolicyRule } from "./otel-collector-rbac.js";
16
18
  export interface CollectorAgentOptions {
17
19
  name: string;
18
20
  namespace: string;
@@ -29,6 +31,8 @@ export interface CollectorAgentOptions {
29
31
  containerPort: number;
30
32
  name: string;
31
33
  }>;
34
+ /** The ClusterRole's rules, from `agentClusterRules`. */
35
+ clusterRules: CollectorPolicyRule[];
32
36
  cpuRequest: string;
33
37
  memoryRequest: string;
34
38
  cpuLimit: string;
@@ -1 +1 @@
1
- {"version":3,"file":"otel-collector-agent.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAErG,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,8EAA8E;IAC9E,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,iEAAiE;IACjE,UAAU,EAAE,MAAM,CAAC;IACnB,2EAA2E;IAC3E,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EA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
  * another namespace moves the agents with it.
16
16
  */
17
17
  import type { Declarable } from "@intentius/chant/declarable";
18
- import { LoadBalancingExporter, OtlpExporter, type LoadBalancingRoutingKey, type OTelComponent, type Signal, type TLSClientSettings } from "@intentius/chant-lexicon-otel";
19
- import { Deployment, Service, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap, PodDisruptionBudget } from "../generated/index.js";
20
- /** One RBAC rule, as a ClusterRole lists it. */
21
- export interface CollectorPolicyRule {
22
- apiGroups: string[];
23
- resources: string[];
24
- verbs: string[];
25
- resourceNames?: string[];
26
- }
18
+ import { LoadBalancingExporter, OtlpExporter, OtlpHttpExporter, type LoadBalancingRoutingKey, type OTelComponent, type Signal, type TLSClientSettings } from "@intentius/chant-lexicon-otel";
19
+ import { Deployment, Service, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap, PodDisruptionBudget, Role, RoleBinding } from "../generated/index.js";
20
+ import { type CollectorPolicyRule } from "./otel-collector-rbac.js";
21
+ export type { CollectorPolicyRule };
27
22
  export interface OtelCollectorGatewayProps {
28
23
  /** Gateway name (default: "otel-gateway"). */
29
24
  name?: string;
@@ -70,6 +65,8 @@ export interface OtelCollectorGatewayProps {
70
65
  podDisruptionBudget?: Partial<Record<string, unknown>>;
71
66
  clusterRole?: Partial<Record<string, unknown>>;
72
67
  clusterRoleBinding?: Partial<Record<string, unknown>>;
68
+ leaseRole?: Partial<Record<string, unknown>>;
69
+ leaseRoleBinding?: Partial<Record<string, unknown>>;
73
70
  };
74
71
  }
75
72
  export type OtelCollectorGatewayResult = {
@@ -82,12 +79,22 @@ export type OtelCollectorGatewayResult = {
82
79
  podDisruptionBudget?: InstanceType<typeof PodDisruptionBudget>;
83
80
  clusterRole?: InstanceType<typeof ClusterRole>;
84
81
  clusterRoleBinding?: InstanceType<typeof ClusterRoleBinding>;
82
+ /**
83
+ * Access to Leases for the `k8s_leader_elector` extensions the config
84
+ * enables, in the first `lease_namespace`. Each further namespace gets
85
+ * `leaseRoleIn<Namespace>` and `leaseRoleBindingIn<Namespace>`.
86
+ */
87
+ leaseRole?: InstanceType<typeof Role>;
88
+ leaseRoleBinding?: InstanceType<typeof RoleBinding>;
89
+ [member: `leaseRoleIn${string}`]: InstanceType<typeof Role>;
90
+ [member: `leaseRoleBindingIn${string}`]: InstanceType<typeof RoleBinding>;
85
91
  };
86
92
  /**
87
93
  * Create an OtelCollectorGateway composite. Returns a Deployment, a ClusterIP
88
94
  * Service, a headless Service, a ServiceAccount and a ConfigMap, a
89
- * PodDisruptionBudget when there is more than one replica, and a ClusterRole
90
- * and binding when `clusterRules` is set.
95
+ * PodDisruptionBudget when there is more than one replica, a ClusterRole
96
+ * and binding when `clusterRules` is set, and a Role and binding for Leases
97
+ * when the config enables a `k8s_leader_elector` extension.
91
98
  *
92
99
  * @example
93
100
  * ```ts
@@ -97,46 +104,17 @@ export type OtelCollectorGatewayResult = {
97
104
  * export const agent = OtelCollector({ exporters: [gatewayExporter(gateway, { loadBalance: true })], signals: ["traces"] });
98
105
  * ```
99
106
  */
100
- export declare const OtelCollectorGateway: import("@intentius/chant").CompositeDefinition<OtelCollectorGatewayProps, {
101
- clusterRole: Declarable & Record<string, string>;
102
- clusterRoleBinding: Declarable & Record<string, string>;
103
- podDisruptionBudget: Declarable & Record<string, string>;
104
- deployment: Declarable & Record<string, string>;
105
- service: Declarable & Record<string, string>;
106
- headlessService: Declarable & Record<string, string>;
107
- serviceAccount: Declarable & Record<string, string>;
108
- configMap: Declarable & Record<string, string>;
109
- } | {
110
- clusterRole?: undefined;
111
- clusterRoleBinding?: undefined;
112
- podDisruptionBudget: Declarable & Record<string, string>;
113
- deployment: Declarable & Record<string, string>;
114
- service: Declarable & Record<string, string>;
115
- headlessService: Declarable & Record<string, string>;
116
- serviceAccount: Declarable & Record<string, string>;
117
- configMap: Declarable & Record<string, string>;
118
- } | {
119
- clusterRole: Declarable & Record<string, string>;
120
- clusterRoleBinding: Declarable & Record<string, string>;
121
- podDisruptionBudget?: undefined;
122
- deployment: Declarable & Record<string, string>;
123
- service: Declarable & Record<string, string>;
124
- headlessService: Declarable & Record<string, string>;
125
- serviceAccount: Declarable & Record<string, string>;
126
- configMap: Declarable & Record<string, string>;
127
- } | {
128
- clusterRole?: undefined;
129
- clusterRoleBinding?: undefined;
130
- podDisruptionBudget?: undefined;
131
- deployment: Declarable & Record<string, string>;
132
- service: Declarable & Record<string, string>;
133
- headlessService: Declarable & Record<string, string>;
134
- serviceAccount: Declarable & Record<string, string>;
135
- configMap: Declarable & Record<string, string>;
136
- }>;
107
+ export declare const OtelCollectorGateway: import("@intentius/chant").CompositeDefinition<OtelCollectorGatewayProps, OtelCollectorGatewayResult>;
137
108
  export interface GatewayExporterOptions {
138
- /** Exporter name, so the id is `otlp/<name>` or `loadbalancing/<name>` (default: "gateway"). */
109
+ /** Exporter name, so the id is `otlp/<name>`, `otlphttp/<name>` or `loadbalancing/<name>` (default: "gateway"). */
139
110
  name?: string;
111
+ /**
112
+ * OTLP over gRPC (an `otlp` exporter) or over HTTP (an `otlphttp`
113
+ * exporter). The `loadbalancing` exporter sends OTLP over gRPC only at the
114
+ * pinned collector version, so `http` cannot be combined with
115
+ * `loadBalance`. Default: "grpc".
116
+ */
117
+ protocol?: "grpc" | "http";
140
118
  /**
141
119
  * Send each trace to one gateway replica through the headless Service with
142
120
  * a `loadbalancing` exporter, instead of to the ClusterIP Service with an
@@ -152,9 +130,13 @@ export interface GatewayExporterOptions {
152
130
  resolver?: "k8s" | "dns";
153
131
  /** What the `loadbalancing` exporter hashes on (default: "traceID"). */
154
132
  routingKey?: LoadBalancingRoutingKey;
155
- /** The gateway Service port to send to, by name (default: "otlp-grpc"). */
133
+ /** The gateway Service port to send to, by name (default: "otlp-grpc", or "otlp-http" with `protocol: "http"`). */
156
134
  port?: string;
157
- /** TLS for the connection to the gateway (default: `{ insecure: true }`, plaintext inside the cluster). */
135
+ /**
136
+ * TLS for the connection to the gateway (default: `{ insecure: true }`,
137
+ * plaintext inside the cluster). Over HTTP, `insecure` picks the scheme
138
+ * (`http://`, or `https://` without it) and the other settings are passed on.
139
+ */
158
140
  tls?: TLSClientSettings;
159
141
  }
160
142
  /**
@@ -163,11 +145,14 @@ export interface GatewayExporterOptions {
163
145
  * config listens on.
164
146
  *
165
147
  * By default an `otlp` exporter at `<service>.<namespace>.svc:<port>`. With
148
+ * `protocol: "http"`, an `otlphttp` exporter at
149
+ * `http://<service>.<namespace>.svc:<port>` (`https://` when `tls` is not
150
+ * `insecure`), sending to the gateway's OTLP HTTP port. With
166
151
  * `loadBalance`, a `loadbalancing` exporter routing by trace id to the
167
152
  * headless Service, through the `k8s` resolver (`<headless>.<namespace>`) or
168
153
  * the `dns` resolver (`<headless>.<namespace>.svc`). Put it in the agent's
169
154
  * pipelines like any other exporter; `OtelCollector` records the link in its
170
155
  * annotations and adds the RBAC the `k8s` resolver needs.
171
156
  */
172
- export declare function gatewayExporter(gateway: OtelCollectorGatewayResult, options?: GatewayExporterOptions): InstanceType<typeof OtlpExporter> | InstanceType<typeof LoadBalancingExporter>;
157
+ export declare function gatewayExporter(gateway: OtelCollectorGatewayResult, options?: GatewayExporterOptions): InstanceType<typeof OtlpExporter> | InstanceType<typeof OtlpHttpExporter> | InstanceType<typeof LoadBalancingExporter>;
173
158
  //# sourceMappingURL=otel-collector-gateway.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otel-collector-gateway.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAEL,qBAAqB,EACrB,YAAY,EAEZ,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,cAAc,EAAE,WAAW,EAAE,kBAAkB,EAAE,SA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AI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,wEAAwE;IACxE,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,2GAA2G;IAC3G,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAaD;;;;;;;;;;;GAWG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,0BAA0B,EACnC,OAAO,GAAE,sBAA2B,GACnC,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CA4BhF"}
1
+ {"version":3,"file":"otel-collector-gateway.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-gateway.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAEL,qBAAqB,EACrB,YAAY,EACZ,gBAAgB,EAEhB,KAAK,uBAAuB,EAC5B,KAAK,aAAa,EAClB,KAAK,MAAM,EACX,KAAK,iBAAiB,EACvB,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,UAAU,EACV,OAAO,EACP,cAAc,EACd,WAAW,EACX,kBAAkB,EAClB,SAAS,EACT,mBAAmB,EACnB,IAAI,EACJ,WAAW,EACZ,MAAM,cAAc,CAAC;AAEtB,OAAO,EAAmB,KAAK,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AASlF,YAAY,EAAE,mBAAmB,EAAE,CAAC;AAEpC,MAAM,WAAW,yBAAyB;IACxC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,QAAQ,CAAC,EAA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AAW,sBAAsB;IACrC,mHAAmH;IACnH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC3B;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB;;;;OAIG;IACH,QAAQ,CAAC,EAAE,KAAK,GAAG,KAAK,CAAC;IACzB,wEAAwE;IACxE,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,mHAAmH;IACnH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;OAIG;IACH,GAAG,CAAC,EAAE,iBAAiB,CAAC;CACzB;AAaD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,eAAe,CAC7B,OAAO,EAAE,0BAA0B,EACnC,OAAO,GAAE,sBAA2B,GACnC,YAAY,CAAC,OAAO,YAAY,CAAC,GAAG,YAAY,CAAC,OAAO,gBAAgB,CAAC,GAAG,YAAY,CAAC,OAAO,qBAAqB,CAAC,CAqCxH"}
@@ -0,0 +1,74 @@
1
+ /**
2
+ * The RBAC the collector composites grant, worked out from the collector
3
+ * config they deploy.
4
+ *
5
+ * `agentClusterRules` is the ClusterRole `OtelCollector` and
6
+ * `GkeOtelCollector` share: what the `k8sattributes` processor needs, plus
7
+ * what the config's Kubernetes receivers need. Each rule cites the
8
+ * component's RBAC requirements at collector-contrib v0.130.0, the version the
9
+ * otel lexicon pins.
10
+ *
11
+ * `namespacedRoles` builds one Role and RoleBinding per namespace, for access
12
+ * a collector needs in namespaces other than its own: Endpoints for a
13
+ * `loadbalancing` exporter's `k8s` resolver, Leases for a
14
+ * `k8s_leader_elector` extension.
15
+ */
16
+ import type { CollectorConfig } from "@intentius/chant-lexicon-otel";
17
+ import { Role, RoleBinding } from "../generated/index.js";
18
+ /** One RBAC rule, as a Role or ClusterRole lists it. */
19
+ export interface CollectorPolicyRule {
20
+ apiGroups: string[];
21
+ resources: string[];
22
+ verbs: string[];
23
+ resourceNames?: string[];
24
+ }
25
+ /**
26
+ * The agent ClusterRole's rules for a collector config.
27
+ *
28
+ * Always, for `k8sattributes` (processor/k8sattributesprocessor README,
29
+ * "Cluster-scoped RBAC"): `get`, `list` and `watch` on pods, namespaces and
30
+ * nodes, and on `apps` replicasets for `k8s.deployment.name`, which is
31
+ * extracted by default. The processor lists ReplicaSets through `apps/v1`
32
+ * only, so the README's `extensions` group is left out. When a
33
+ * `k8sattributes` processor extracts labels or annotations `from: deployment`,
34
+ * `apps` deployments are added.
35
+ *
36
+ * For each `kubeletstats` receiver (receiver/kubeletstatsreceiver README,
37
+ * "Role-based access control"): `get` on `nodes/stats`; `get` on
38
+ * `nodes/proxy` when it sets `extra_metadata_labels` or enables a
39
+ * `*_request_utilization` or `*_limit_utilization` metric; and, when it sets
40
+ * `k8s_api_config`, `get` on persistentvolumeclaims and persistentvolumes,
41
+ * which it reads for volume metadata (scraper.go).
42
+ *
43
+ * Other components that read the Kubernetes API, such as `k8s_cluster`
44
+ * (which belongs on a gateway, see WK8603), add their rules through
45
+ * `defaults.clusterRole.rules`, which are appended.
46
+ */
47
+ export declare function agentClusterRules(config: CollectorConfig): CollectorPolicyRule[];
48
+ export interface NamespacedRolesOptions {
49
+ /** Prefix of the member names: `<key>Role` and `<key>RoleBinding`. */
50
+ key: string;
51
+ /** Name of each Role and RoleBinding. They live in different namespaces, so one name serves all. */
52
+ name: string;
53
+ /** Namespaces to grant in, in declaration order. */
54
+ namespaces: string[];
55
+ rules: CollectorPolicyRule[];
56
+ labels: Record<string, string>;
57
+ /** The ServiceAccount every RoleBinding binds. */
58
+ serviceAccount: {
59
+ name: string;
60
+ namespace: string;
61
+ };
62
+ /** Defaults laid over each Role and each RoleBinding. */
63
+ roleDefaults?: Partial<Record<string, unknown>>;
64
+ roleBindingDefaults?: Partial<Record<string, unknown>>;
65
+ }
66
+ /**
67
+ * One Role and RoleBinding per namespace, as composite members. The first
68
+ * namespace's are `<key>Role` and `<key>RoleBinding`, so a single-namespace
69
+ * config keeps the member names it had before; each further namespace's are
70
+ * `<key>RoleIn<Namespace>` and `<key>RoleBindingIn<Namespace>`, with the
71
+ * namespace in PascalCase (`team-a` gives `endpointsRoleInTeamA`).
72
+ */
73
+ export declare function namespacedRoles(opts: NamespacedRolesOptions): Record<string, InstanceType<typeof Role> | InstanceType<typeof RoleBinding>>;
74
+ //# sourceMappingURL=otel-collector-rbac.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"otel-collector-rbac.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-rbac.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAEjD,wDAAwD;AACxD,MAAM,WAAW,mBAAmB;IAClC,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;CAC1B;AAUD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,eAAe,GAAG,mBAAmB,EAAE,CA+BhF;AAUD,MAAM,WAAW,sBAAsB;IACrC,sEAAsE;IACtE,GAAG,EAAE,MAAM,CAAC;IACZ,oGAAoG;IACpG,IAAI,EAAE,MAAM,CAAC;IACb,oDAAoD;IACpD,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,EAAE,mBAAmB,EAAE,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,kDAAkD;IAClD,cAAc,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC;IACpD,yDAAyD;IACzD,YAAY,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;IAChD,mBAAmB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACxD;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC,CAqB1I"}
@@ -70,4 +70,11 @@ export declare function collectorRuntime(entities: Declarable[]): CollectorRunti
70
70
  * collector's own namespace, `name.namespace` in that one.
71
71
  */
72
72
  export declare function k8sResolverNamespaces(built: BuiltCollector, ownNamespace: string): string[];
73
+ /**
74
+ * The namespaces of the Leases a config's `k8s_leader_elector` extensions
75
+ * take, for those `service.extensions` enables (the collector starts no
76
+ * other). An elector without `lease_namespace` fails the otel lexicon's
77
+ * OTEL107 and is skipped here.
78
+ */
79
+ export declare function leaderElectorLeaseNamespaces(built: BuiltCollector): string[];
73
80
  //# sourceMappingURL=otel-collector-shape.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otel-collector-shape.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-shape.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAKL,KAAK,cAAc,EACpB,MAAM,+BAA+B,CAAC;AAEvC;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,0BAA0B;;;;;CAK7B,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,SAAS,CAAC;AAEhD,sGAAsG;AACtG,MAAM,MAAM,cAAc,GAAG,SAAS,GAAG,eAAe,CAAC;AAEzD,sEAAsE;AACtE,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,OA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G,MAAM,EAAE,CAW5E"}
@@ -58,9 +58,15 @@ export interface OtelCollectorProps {
58
58
  }
59
59
  export type OtelCollectorResult = CollectorAgentResources & {
60
60
  service: InstanceType<typeof Service>;
61
- /** Read access to Endpoints for a `loadbalancing` exporter's `k8s` resolver, in the resolved Service's namespace. */
61
+ /**
62
+ * Read access to Endpoints for a `loadbalancing` exporter's `k8s` resolver,
63
+ * in the first namespace the resolvers point at. Each further namespace
64
+ * gets `endpointsRoleIn<Namespace>` and `endpointsRoleBindingIn<Namespace>`.
65
+ */
62
66
  endpointsRole?: InstanceType<typeof Role>;
63
67
  endpointsRoleBinding?: InstanceType<typeof RoleBinding>;
68
+ [member: `endpointsRoleIn${string}`]: InstanceType<typeof Role>;
69
+ [member: `endpointsRoleBindingIn${string}`]: InstanceType<typeof RoleBinding>;
64
70
  };
65
71
  /**
66
72
  * Create an OtelCollector composite. Returns a DaemonSet, Service,
@@ -76,23 +82,5 @@ export type OtelCollectorResult = CollectorAgentResources & {
76
82
  * });
77
83
  * ```
78
84
  */
79
- export declare const OtelCollector: import("@intentius/chant").CompositeDefinition<OtelCollectorProps, {
80
- endpointsRole: Declarable & Record<string, string>;
81
- endpointsRoleBinding: Declarable & Record<string, string>;
82
- service: Declarable & Record<string, string>;
83
- daemonSet: InstanceType<typeof import("../index.js").DaemonSet>;
84
- serviceAccount: InstanceType<typeof import("../index.js").ServiceAccount>;
85
- clusterRole: InstanceType<typeof import("../index.js").ClusterRole>;
86
- clusterRoleBinding: InstanceType<typeof import("../index.js").ClusterRoleBinding>;
87
- configMap: InstanceType<typeof import("../index.js").ConfigMap>;
88
- } | {
89
- endpointsRole?: undefined;
90
- endpointsRoleBinding?: undefined;
91
- service: Declarable & Record<string, string>;
92
- daemonSet: InstanceType<typeof import("../index.js").DaemonSet>;
93
- serviceAccount: InstanceType<typeof import("../index.js").ServiceAccount>;
94
- clusterRole: InstanceType<typeof import("../index.js").ClusterRole>;
95
- clusterRoleBinding: InstanceType<typeof import("../index.js").ClusterRoleBinding>;
96
- configMap: InstanceType<typeof import("../index.js").ConfigMap>;
97
- }>;
85
+ export declare const OtelCollector: import("@intentius/chant").CompositeDefinition<OtelCollectorProps, OtelCollectorResult>;
98
86
  //# sourceMappingURL=otel-collector.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"otel-collector.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAGL,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC1D,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAS/F,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAAmG;IACnG,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,MAAM,CAAC,EAAE,QAAQ,CAAC,UAAU,CAAC,CAAC;IAC9B,wEAAwE;IACxE,SAAS,CAAC,EAAE,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC;IACrD,wFAAwF;IACxF,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,yBAAyB;IACzB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAChC,qCAAqC;IACrC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,yCAAyC;IACzC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,mCAAmC;IACnC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,uCAAuC;IACvC,WAAW,CAAC,EAAE,M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E,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC/C,kBAAkB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACtD,SAAS,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QAC7C,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;QACjD,oBAAoB,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACzD,CAAC;CACH;AAED,MAAM,MAAM,mBAAmB,GAAG,uBAAuB,GAAG;IAC1D,OAAO,EAAE,YAAY,CAAC,OAAO,OAAO,CAAC,CAAC;IACtC;;;;OAIG;IACH,aAAa,CAAC,EAAE,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IAC1C,oBAAoB,CAAC,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;IACxD,CAAC,MAAM,EAAE,kBAAkB,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,IAAI,CAAC,CAAC;IAChE,CAAC,MAAM,EAAE,yBAAyB,MAAM,EAAE,GAAG,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;CAC/E,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa,yFA2FP,CAAC"}
@@ -9,6 +9,11 @@ export declare function stripServerFields(obj: Record<string, unknown>): Record<
9
9
  * `items` of a `kubectl get -o json` List). Reuses the import K8sParser by
10
10
  * feeding it the cleaned objects as JSON documents — JSON is valid YAML, so no
11
11
  * separate serializer is needed. Pure: all I/O stays in the caller.
12
+ *
13
+ * The result's `reparse(context)` parses the same objects again with a
14
+ * `ParseContext`, so `chant import --from` hands embedded content (a
15
+ * collector config in a ConfigMap, a PrometheusRule's groups) to the lexicon
16
+ * that owns it, as file import does (#2995).
12
17
  */
13
18
  export declare function buildExportFromObjects(objects: unknown[], opts?: {
14
19
  verbatim?: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../src/import/live-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA8BnF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAavF;AAED;;;;;GAKG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAAE,EAClB,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9E,gBAAgB,CA8BlB"}
1
+ {"version":3,"file":"live-export.d.ts","sourceRoot":"","sources":["../../src/import/live-export.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AA+BnF;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAavF;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,OAAO,EAAE,EAClB,IAAI,GAAE;IAAE,QAAQ,CAAC,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,EAAE,gBAAgB,CAAC;IAAC,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAC9E,gBAAgB,CAgBlB"}
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "algorithm": "sha256",
3
3
  "artifacts": {
4
- "manifest.json": "1a8204a45d432f44bf6760aff2619dba20707d1e4c2f5fcb1aea1d5aa53daf96",
4
+ "manifest.json": "ed73bb8ccc1cddd4feafe27ddd89fdbfd0a5864d67e392ed8ddb85632d4be34a",
5
5
  "meta.json": "8b999bc142f448b0b627ecdc9e2388bbe672c8a1f7aae5303135624cf2fe65e3",
6
6
  "types/index.d.ts": "5f67de738adb455805e72600948940af9c664283785fb68c9fd8f5ea90d42cc3",
7
7
  "rules/argo-appset-single-project.ts": "afa9f310753aa2d475f35012b13135b2dfaebed2a35d44edbe185ebc07673674",
@@ -19,7 +19,7 @@
19
19
  "rules/flux002.ts": "4269ce13121bc5b28c02aad06765dc85085a1c9ebcc936ae958663b85de07bc6",
20
20
  "rules/flux003.ts": "a174af9941bd2491a9bbf72039ab2fc4d4f4de388b2884ddf7123f05594d9d4e",
21
21
  "rules/k8s-helpers.ts": "868cac99b4505a8e060384a716047646da1583568ef6da471a186dc760961212",
22
- "rules/otel-placement-helpers.ts": "dcf50dadb77bf676f4690b865938b71cfacdca506b93371bbf9db81ac1d6a0f5",
22
+ "rules/otel-placement-helpers.ts": "bb24ab6b8fe92cb38f94720d6f5351ddc63144d1741745b4d8b4b2dd9f927255",
23
23
  "rules/sops-helpers.ts": "c2b8e08e7d292e770fd4761ad2a55e165c7cd375768b709491165cbf4fa1ba51",
24
24
  "rules/wk8005.ts": "c80c4962e2015ce15266dd2080014fcabf1412ca35e8475ae41aa895c5684b78",
25
25
  "rules/wk8006.ts": "3992f695985fd8473f6bc1f85027f13b0824f7c0bd1c1305a0a29a3c0757f45a",
@@ -59,6 +59,7 @@
59
59
  "rules/wk8601.ts": "0fd5eb0fc7c0e645d93be4b265a8f2be996765db849809fdd2b4d7e3866353be",
60
60
  "rules/wk8602.ts": "aad3b84dd8744afb0e0e7926973d9a07123ab29125eb85823cbfdde4b03d4177",
61
61
  "rules/wk8603.ts": "cffee84ddda68798e023c0d1a0eebb3b51546467b53779ffea84e1595bd2f8ad",
62
+ "rules/wk8604.ts": "2086d9909b5f529388ac6ad1a5ce28659d26559e7ff6e505c9f03869630b5ddd",
62
63
  "skills/chant-k8s.md": "324d222bd4c48ae1f562bedf982c6be793e74179daf659ca2df70f6a3702b4ff",
63
64
  "skills/chant-k8s-patterns.md": "683148e9f0f9da6879bd65d97c82cc29dbff897e31bc11b3c1de654cd6baeea3",
64
65
  "skills/chant-k8s-deployment-strategies.md": "c4cc93cba064230567baa755b5a3493dc69bfc6e74a62e1990d12039ffaaf5f8",
@@ -69,5 +70,5 @@
69
70
  "skills/chant-k8s-argo.md": "24c9a85b78a2fc5c6657424baac9cc6d6caff6f47605b8146b2c0082133181cf",
70
71
  "skills/chant-k8s-flux.md": "9670efc2e9854bd14686b5adeb707396b9030a4dcaee6529b30abf56efe2c50c"
71
72
  },
72
- "composite": "5680cfa0b7d42111693a68a763446b0351130e6050a629ddcbf9387075214303"
73
+ "composite": "dd56b1357b2397437f6a446ff77194db3c9582f45a96e391c7d86652c916211f"
73
74
  }
@@ -1 +1 @@
1
- {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqD,KAAK,QAAQ,EAAgB,MAAM,gCAAgC,CAAC;AAGhI,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA4CpD,CAAC"}
1
+ {"version":3,"file":"audit-catalog.d.ts","sourceRoot":"","sources":["../../src/lint/audit-catalog.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAAqD,KAAK,QAAQ,EAAgB,MAAM,gCAAgC,CAAC;AAGhI,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,QAAQ,CA6CpD,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AA6CvE,eAAO,MAAM,eAAe,EAAE,cAAc,EA4C3C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AA8CvE,eAAO,MAAM,eAAe,EAAE,cAAc,EA6C3C,CAAC"}
@@ -62,7 +62,11 @@ export interface CollectorPlacement {
62
62
  key: string;
63
63
  config: CollectorConfigShape;
64
64
  }
65
- /** Parse a ConfigMap value as a collector config, or undefined when it isn't one. */
65
+ /**
66
+ * Parse a ConfigMap value as a collector config, or undefined when it isn't
67
+ * one. The otel lexicon's parser, shared with its config checks (OTEL101 and
68
+ * the rest) and WK8604 so every check agrees on what counts as a config.
69
+ */
66
70
  export declare function parseCollectorConfig(text: unknown): CollectorConfigShape | undefined;
67
71
  /** The `type` of a component id: `tail_sampling/errors` is `tail_sampling`. */
68
72
  export declare function componentType(id: string): string;
@@ -1 +1 @@
1
- {"version":3,"file":"otel-placement-helpers.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/otel-placement-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAqC,KAAK,WAAW,EAAE,MAAM,eAAe,CAAC;AAEpF,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,gEAAgE;AAChE,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,OAAO,EAAE;QACP,UAAU,CAAC,EAAE,OAAO,CAAC;QACrB,SAAS,EAAE,MAAM,CAAC,MAA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C,CAE9I;AAED,2DAA2D;AAC3D,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,oBAAoB,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAM5F;AAkDD,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,WAAW,EAAE,GAAG,kBAAkB,EAAE,CA6ClF;AAED,uFAAuF;AACvF,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,kBAAkB,GAAG,MAAM,CAE/D;AAID,gDAAgD;AAChD,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;CACnB;AAED,6FAA6F;AAC7F,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,WAAW,EAAE,EAAE,QAAQ,EAAE,WAAW,GAAG,gBAAgB,EAAE,CAYrG;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAOvF;AAED,sGAAsG;AACtG,wBAAgB,cAAc,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAOpE"}
@@ -0,0 +1,19 @@
1
+ /**
2
+ * WK8604: the otel config checks over collector configs in ConfigMaps
3
+ *
4
+ * `OtelCollector`, `OtelCollectorGateway`, `GkeOtelCollector` and hand-written
5
+ * manifests carry the collector config as a string under a ConfigMap data key.
6
+ * `chant build` gives each lexicon's checks only that lexicon's output, so the
7
+ * otel lexicon's config checks never see a config that lives in the k8s output
8
+ * (chant #2930). This check runs them there: every ConfigMap data value that
9
+ * parses as a collector config (a `service.pipelines` map) goes through the
10
+ * otel lexicon's `validateCollectorConfig`.
11
+ *
12
+ * Findings keep the otel rule ids (OTEL101-OTEL106, OTEL112-OTEL117, and any config
13
+ * check the otel lexicon adds later), so `lint.rules` and suppressions name
14
+ * one id wherever the config lives. Each message names the ConfigMap's
15
+ * namespace, name and key. Needs only the k8s lexicon in the project.
16
+ */
17
+ import type { PostSynthCheck } from "@intentius/chant/lint/post-synth";
18
+ export declare const wk8604: PostSynthCheck;
19
+ //# sourceMappingURL=wk8604.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wk8604.d.ts","sourceRoot":"","sources":["../../../src/lint/post-synth/wk8604.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAyC,MAAM,kCAAkC,CAAC;AAG9G,eAAO,MAAM,MAAM,EAAE,cAQpB,CAAC"}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "k8s",
3
- "version": "0.99.0",
3
+ "version": "0.101.0",
4
4
  "chantVersion": ">=0.1.0",
5
5
  "namespace": "K8s",
6
6
  "intrinsics": [],
package/dist/okf/index.md CHANGED
@@ -283,3 +283,4 @@ okf_version: '0.2'
283
283
  * [WK8601](/rules/WK8601.md) - OpenTelemetry Collector runs tail_sampling as a per-node DaemonSet; each agent sees only its node's spans, so decisions are made on partial traces. Sees one...
284
284
  * [WK8602](/rules/WK8602.md) - OpenTelemetry Collector gateway runs tail_sampling on more than one replica, but collectors send it traces without a loadbalancing exporter routed by traceID...
285
285
  * [WK8603](/rules/WK8603.md) - OpenTelemetry Collector runs the k8s_cluster receiver in a DaemonSet or multi-replica workload without a k8s_leader_elector; every copy reports every cluster...
286
+ * [WK8604](/rules/WK8604.md) - OpenTelemetry Collector config in a ConfigMap fails the otel lexicon's config checks; findings are reported under their OTEL1xx ids, naming the ConfigMap and...
@@ -0,0 +1,11 @@
1
+ ---
2
+ type: post-synth-check
3
+ title: WK8604
4
+ description: OpenTelemetry Collector config in a ConfigMap fails the otel lexicon's config checks; findings are reported under their OTEL1xx ids, naming the ConfigMap and key.
5
+ id: WK8604
6
+ severity: error
7
+ category: post-synth
8
+ lexicon: k8s
9
+ docs: https://intentius.io/chant/lexicons/k8s/rules/
10
+ ---
11
+ OpenTelemetry Collector config in a ConfigMap fails the otel lexicon's config checks; findings are reported under their OTEL1xx ids, naming the ConfigMap and key.
@@ -25,7 +25,7 @@
25
25
  * `OTEL_COLLECTOR_ANNOTATIONS`.
26
26
  */
27
27
 
28
- import { load } from "js-yaml";
28
+ import { parseCollectorConfig as parseOtelCollectorConfig } from "@intentius/chant-lexicon-otel/configmap";
29
29
  import { extractContainers, extractPodSpec, type K8sManifest } from "./k8s-helpers";
30
30
 
31
31
  export const PLACEMENT_ANNOTATIONS = {
@@ -80,17 +80,13 @@ function isRecord(v: unknown): v is Record<string, unknown> {
80
80
  return typeof v === "object" && v !== null && !Array.isArray(v);
81
81
  }
82
82
 
83
- /** Parse a ConfigMap value as a collector config, or undefined when it isn't one. */
83
+ /**
84
+ * Parse a ConfigMap value as a collector config, or undefined when it isn't
85
+ * one. The otel lexicon's parser, shared with its config checks (OTEL101 and
86
+ * the rest) and WK8604 so every check agrees on what counts as a config.
87
+ */
84
88
  export function parseCollectorConfig(text: unknown): CollectorConfigShape | undefined {
85
- if (typeof text !== "string") return undefined;
86
- let value: unknown;
87
- try {
88
- value = load(text);
89
- } catch {
90
- return undefined;
91
- }
92
- if (!isRecord(value) || !isRecord(value.service) || !isRecord(value.service.pipelines)) return undefined;
93
- return value as unknown as CollectorConfigShape;
89
+ return parseOtelCollectorConfig(text) as CollectorConfigShape | undefined;
94
90
  }
95
91
 
96
92
  /** The `type` of a component id: `tail_sampling/errors` is `tail_sampling`. */
@@ -0,0 +1,29 @@
1
+ /**
2
+ * WK8604: the otel config checks over collector configs in ConfigMaps
3
+ *
4
+ * `OtelCollector`, `OtelCollectorGateway`, `GkeOtelCollector` and hand-written
5
+ * manifests carry the collector config as a string under a ConfigMap data key.
6
+ * `chant build` gives each lexicon's checks only that lexicon's output, so the
7
+ * otel lexicon's config checks never see a config that lives in the k8s output
8
+ * (chant #2930). This check runs them there: every ConfigMap data value that
9
+ * parses as a collector config (a `service.pipelines` map) goes through the
10
+ * otel lexicon's `validateCollectorConfig`.
11
+ *
12
+ * Findings keep the otel rule ids (OTEL101-OTEL106, OTEL112-OTEL117, and any config
13
+ * check the otel lexicon adds later), so `lint.rules` and suppressions name
14
+ * one id wherever the config lives. Each message names the ConfigMap's
15
+ * namespace, name and key. Needs only the k8s lexicon in the project.
16
+ */
17
+
18
+ import type { PostSynthCheck, PostSynthContext, PostSynthDiagnostic } from "@intentius/chant/lint/post-synth";
19
+ import { collectorConfigDiagnostics } from "@intentius/chant-lexicon-otel/lint/post-synth/otel-helpers";
20
+
21
+ export const wk8604: PostSynthCheck = {
22
+ id: "WK8604",
23
+ description:
24
+ "OpenTelemetry Collector config in a ConfigMap fails the otel lexicon's config checks; findings are reported under their OTEL1xx ids, naming the ConfigMap and key.",
25
+
26
+ check(ctx: PostSynthContext): PostSynthDiagnostic[] {
27
+ return collectorConfigDiagnostics(ctx, { configMapsOnly: true });
28
+ },
29
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intentius/chant-lexicon-k8s",
3
- "version": "0.99.0",
3
+ "version": "0.101.0",
4
4
  "description": "Kubernetes lexicon for chant — declarative IaC in TypeScript",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://intentius.io/chant",
@@ -78,7 +78,7 @@
78
78
  "@types/js-yaml": "^4.0.9"
79
79
  },
80
80
  "optionalDependencies": {
81
- "@intentius/chant-k8s-client": "^0.99.0"
81
+ "@intentius/chant-k8s-client": "^0.101.0"
82
82
  },
83
83
  "devDependencies": {
84
84
  "@intentius/chant": "*",
@@ -86,7 +86,7 @@
86
86
  },
87
87
  "peerDependencies": {
88
88
  "zod": "^4.3.6",
89
- "@intentius/chant": "^0.99.0",
89
+ "@intentius/chant": "^0.101.0",
90
90
  "typescript": "^5.9.3"
91
91
  }
92
92
  }