@intentius/chant-lexicon-k8s 0.80.0 → 0.82.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.
- package/dist/composites/gke-otel-collector.d.ts +7 -15
- package/dist/composites/gke-otel-collector.d.ts.map +1 -1
- package/dist/composites/index.d.ts +2 -0
- package/dist/composites/index.d.ts.map +1 -1
- package/dist/composites/otel-collector-agent.d.ts +53 -0
- package/dist/composites/otel-collector-agent.d.ts.map +1 -0
- package/dist/composites/otel-collector.d.ts +80 -0
- package/dist/composites/otel-collector.d.ts.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/integrity.json +2 -2
- package/dist/manifest.json +1 -1
- package/package.json +4 -3
- package/src/composites/composites.test.ts +175 -0
- package/src/composites/gke-otel-collector.ts +57 -154
- package/src/composites/index.ts +2 -0
- package/src/composites/otel-collector-agent.ts +159 -0
- package/src/composites/otel-collector.ts +160 -0
- package/src/index.ts +2 -1
|
@@ -3,8 +3,12 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @gke Like AdotCollector but targets Cloud Trace + Cloud Monitoring via the
|
|
5
5
|
* googlecloud exporter and uses GKE Workload Identity instead of IRSA.
|
|
6
|
+
*
|
|
7
|
+
* The collector config is typed through the otel lexicon
|
|
8
|
+
* (`@intentius/chant-lexicon-otel`) and rendered with its `collectorYaml`, so
|
|
9
|
+
* it is checked the way any declared collector config is.
|
|
6
10
|
*/
|
|
7
|
-
import {
|
|
11
|
+
import { type CollectorAgentResources } from "./otel-collector-agent.js";
|
|
8
12
|
export interface GkeOtelCollectorProps {
|
|
9
13
|
/** GKE cluster name. */
|
|
10
14
|
clusterName: string;
|
|
@@ -37,13 +41,7 @@ export interface GkeOtelCollectorProps {
|
|
|
37
41
|
configMap?: Partial<Record<string, unknown>>;
|
|
38
42
|
};
|
|
39
43
|
}
|
|
40
|
-
export
|
|
41
|
-
daemonSet: InstanceType<typeof DaemonSet>;
|
|
42
|
-
serviceAccount: InstanceType<typeof ServiceAccount>;
|
|
43
|
-
clusterRole: InstanceType<typeof ClusterRole>;
|
|
44
|
-
clusterRoleBinding: InstanceType<typeof ClusterRoleBinding>;
|
|
45
|
-
configMap: InstanceType<typeof ConfigMap>;
|
|
46
|
-
}
|
|
44
|
+
export type GkeOtelCollectorResult = CollectorAgentResources;
|
|
47
45
|
/**
|
|
48
46
|
* Create a GkeOtelCollector composite — returns prop objects for
|
|
49
47
|
* a DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, and ConfigMap.
|
|
@@ -60,11 +58,5 @@ export interface GkeOtelCollectorResult {
|
|
|
60
58
|
* });
|
|
61
59
|
* ```
|
|
62
60
|
*/
|
|
63
|
-
export declare const GkeOtelCollector: import("@intentius/chant").CompositeDefinition<GkeOtelCollectorProps,
|
|
64
|
-
daemonSet: import("@intentius/chant").Declarable & Record<string, string>;
|
|
65
|
-
serviceAccount: import("@intentius/chant").Declarable & Record<string, string>;
|
|
66
|
-
clusterRole: import("@intentius/chant").Declarable & Record<string, string>;
|
|
67
|
-
clusterRoleBinding: import("@intentius/chant").Declarable & Record<string, string>;
|
|
68
|
-
configMap: import("@intentius/chant").Declarable & Record<string, string>;
|
|
69
|
-
}>;
|
|
61
|
+
export declare const GkeOtelCollector: import("@intentius/chant").CompositeDefinition<GkeOtelCollectorProps, CollectorAgentResources>;
|
|
70
62
|
//# sourceMappingURL=gke-otel-collector.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gke-otel-collector.d.ts","sourceRoot":"","sources":["../../src/composites/gke-otel-collector.ts"],"names":[],"mappings":"AAAA
|
|
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,w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Account } f
|
|
|
65
65
|
export type { WorkloadIdentityServiceAccountProps as AksWorkloadIdentityServiceAccountProps, WorkloadIdentityServiceAccountResult as AksWorkloadIdentityServiceAccountResult } from "./workload-identity-sa.js";
|
|
66
66
|
export { GkeFluentBitAgent } from "./gke-fluent-bit-agent.js";
|
|
67
67
|
export type { GkeFluentBitAgentProps, GkeFluentBitAgentResult } from "./gke-fluent-bit-agent.js";
|
|
68
|
+
export { OtelCollector } from "./otel-collector.js";
|
|
69
|
+
export type { OtelCollectorProps, OtelCollectorResult } from "./otel-collector.js";
|
|
68
70
|
export { GkeOtelCollector } from "./gke-otel-collector.js";
|
|
69
71
|
export type { GkeOtelCollectorProps, GkeOtelCollectorResult } from "./gke-otel-collector.js";
|
|
70
72
|
export { GkeExternalDnsAgent } from "./gke-external-dns-agent.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/composites/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,iBAAiB,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,YAAY,EAAE,sBAAsB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC5F,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,YAAY,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM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,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,YAAY,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAClH,OAAO,EAAE,KAAK,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AACxD,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC9F,YAAY,EACV,YAAY,EAAE,wBAAwB,EAAE,yBAAyB,EAAE,mBAAmB,EAAE,mBAAmB,GAC5G,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Kubernetes resources an OpenTelemetry Collector agent needs, shared by
|
|
3
|
+
* `OtelCollector` and `GkeOtelCollector`: a DaemonSet running the collector
|
|
4
|
+
* with its config mounted from a ConfigMap, and a ServiceAccount bound to a
|
|
5
|
+
* ClusterRole that reads pods, nodes and workloads.
|
|
6
|
+
*
|
|
7
|
+
* The caller renders the collector config (with the otel lexicon's
|
|
8
|
+
* `collectorYaml`) and says which ports the container exposes. Everything
|
|
9
|
+
* platform-specific, such as a Workload Identity annotation or probes, comes
|
|
10
|
+
* in as an option, so each composite keeps its own output.
|
|
11
|
+
*/
|
|
12
|
+
import { DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap } from "../generated/index.js";
|
|
13
|
+
export interface CollectorAgentOptions {
|
|
14
|
+
name: string;
|
|
15
|
+
namespace: string;
|
|
16
|
+
image: string;
|
|
17
|
+
/** Labels on every resource, and (with `extraLabels`) on the pod template. */
|
|
18
|
+
commonLabels: Record<string, string>;
|
|
19
|
+
/** Labels the caller added, repeated on the pod template. */
|
|
20
|
+
extraLabels: Record<string, string>;
|
|
21
|
+
/** The rendered collector config, stored under `config.yaml`. */
|
|
22
|
+
configYaml: string;
|
|
23
|
+
/** Directory the config is mounted in. The file is `<dir>/config.yaml`. */
|
|
24
|
+
configDir: string;
|
|
25
|
+
ports: Array<{
|
|
26
|
+
containerPort: number;
|
|
27
|
+
name: string;
|
|
28
|
+
}>;
|
|
29
|
+
cpuRequest: string;
|
|
30
|
+
memoryRequest: string;
|
|
31
|
+
cpuLimit: string;
|
|
32
|
+
memoryLimit: string;
|
|
33
|
+
/** Extra container fields, such as probes. Added after the standard ones. */
|
|
34
|
+
containerExtra?: Record<string, unknown>;
|
|
35
|
+
/** Annotations on the ServiceAccount, such as a cloud identity binding. */
|
|
36
|
+
serviceAccountAnnotations?: Record<string, string>;
|
|
37
|
+
defaults?: {
|
|
38
|
+
daemonSet?: Partial<Record<string, unknown>>;
|
|
39
|
+
serviceAccount?: Partial<Record<string, unknown>>;
|
|
40
|
+
clusterRole?: Partial<Record<string, unknown>>;
|
|
41
|
+
clusterRoleBinding?: Partial<Record<string, unknown>>;
|
|
42
|
+
configMap?: Partial<Record<string, unknown>>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
export type CollectorAgentResources = {
|
|
46
|
+
daemonSet: InstanceType<typeof DaemonSet>;
|
|
47
|
+
serviceAccount: InstanceType<typeof ServiceAccount>;
|
|
48
|
+
clusterRole: InstanceType<typeof ClusterRole>;
|
|
49
|
+
clusterRoleBinding: InstanceType<typeof ClusterRoleBinding>;
|
|
50
|
+
configMap: InstanceType<typeof ConfigMap>;
|
|
51
|
+
};
|
|
52
|
+
export declare function collectorAgentResources(opts: CollectorAgentOptions): CollectorAgentResources;
|
|
53
|
+
//# sourceMappingURL=otel-collector-agent.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel-collector-agent.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector-agent.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAGH,OAAO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AO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KAC9C,CAAC;CACH;AAED,MAAM,MAAM,uBAAuB,GAAG;IACpC,SAAS,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;IAC1C,cAAc,EAAE,YAAY,CAAC,OAAO,cAAc,CAAC,CAAC;IACpD,WAAW,EAAE,YAAY,CAAC,OAAO,WAAW,CAAC,CAAC;IAC9C,kBAAkB,EAAE,YAAY,CAAC,OAAO,kBAAkB,CAAC,CAAC;IAC5D,SAAS,EAAE,YAAY,CAAC,OAAO,SAAS,CAAC,CAAC;CAC3C,CAAC;AAEF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,qBAAqB,GAAG,uBAAuB,CAyG5F"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OtelCollector composite: an OpenTelemetry Collector agent on any
|
|
3
|
+
* Kubernetes cluster.
|
|
4
|
+
*
|
|
5
|
+
* A DaemonSet runs the collector on every node, with its config mounted from
|
|
6
|
+
* a ConfigMap, and a Service with `internalTrafficPolicy: Local` sends each
|
|
7
|
+
* pod's OTLP traffic to the collector on its own node. The config is declared
|
|
8
|
+
* with the otel lexicon (`@intentius/chant-lexicon-otel`) and rendered with
|
|
9
|
+
* `collectorYaml`. The container ports, the Service ports and the probes are
|
|
10
|
+
* read back from that config, so they follow whatever config is passed in.
|
|
11
|
+
*
|
|
12
|
+
* `GkeOtelCollector` builds the same DaemonSet, RBAC and ConfigMap for GKE.
|
|
13
|
+
*/
|
|
14
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
15
|
+
import { type OTelComponent, type Signal } from "@intentius/chant-lexicon-otel";
|
|
16
|
+
import { Service } from "../generated/index.js";
|
|
17
|
+
import { type CollectorAgentResources } from "./otel-collector-agent.js";
|
|
18
|
+
export interface OtelCollectorProps {
|
|
19
|
+
/** Agent name (default: "otel-collector"). */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Namespace (default: "observability"). */
|
|
22
|
+
namespace?: string;
|
|
23
|
+
/** Collector image (default: the contrib image at the otel lexicon's pinned collector version). */
|
|
24
|
+
image?: string;
|
|
25
|
+
/**
|
|
26
|
+
* The collector config, as otel lexicon entities (components and
|
|
27
|
+
* pipelines). Replaces the default config, and `exporters` and `signals`
|
|
28
|
+
* are then ignored.
|
|
29
|
+
*/
|
|
30
|
+
config?: Iterable<Declarable>;
|
|
31
|
+
/** Exporters for the default config (default: one `debug` exporter). */
|
|
32
|
+
exporters?: OTelComponent<"exporter", string, any>[];
|
|
33
|
+
/** Signals the default config has pipelines for (default: traces, metrics and logs). */
|
|
34
|
+
signals?: Signal[];
|
|
35
|
+
/** Additional labels. */
|
|
36
|
+
labels?: Record<string, string>;
|
|
37
|
+
/** CPU request (default: "100m"). */
|
|
38
|
+
cpuRequest?: string;
|
|
39
|
+
/** Memory request (default: "256Mi"). */
|
|
40
|
+
memoryRequest?: string;
|
|
41
|
+
/** CPU limit (default: "500m"). */
|
|
42
|
+
cpuLimit?: string;
|
|
43
|
+
/** Memory limit (default: "512Mi"). */
|
|
44
|
+
memoryLimit?: string;
|
|
45
|
+
/** Per-member defaults for fine-grained overrides. */
|
|
46
|
+
defaults?: {
|
|
47
|
+
daemonSet?: Partial<Record<string, unknown>>;
|
|
48
|
+
service?: Partial<Record<string, unknown>>;
|
|
49
|
+
serviceAccount?: Partial<Record<string, unknown>>;
|
|
50
|
+
clusterRole?: Partial<Record<string, unknown>>;
|
|
51
|
+
clusterRoleBinding?: Partial<Record<string, unknown>>;
|
|
52
|
+
configMap?: Partial<Record<string, unknown>>;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
export type OtelCollectorResult = CollectorAgentResources & {
|
|
56
|
+
service: InstanceType<typeof Service>;
|
|
57
|
+
};
|
|
58
|
+
/**
|
|
59
|
+
* Create an OtelCollector composite. Returns a DaemonSet, Service,
|
|
60
|
+
* ServiceAccount, ClusterRole, ClusterRoleBinding and ConfigMap.
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* import { OtelCollector } from "@intentius/chant-lexicon-k8s";
|
|
65
|
+
* import { OtlpExporter } from "@intentius/chant-lexicon-otel";
|
|
66
|
+
*
|
|
67
|
+
* export const collector = OtelCollector({
|
|
68
|
+
* exporters: [new OtlpExporter({ endpoint: "tempo.observability.svc:4317", tls: { insecure: true } })],
|
|
69
|
+
* });
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare const OtelCollector: import("@intentius/chant").CompositeDefinition<OtelCollectorProps, {
|
|
73
|
+
service: Declarable & Record<string, string>;
|
|
74
|
+
daemonSet: InstanceType<typeof import("../index.js").DaemonSet>;
|
|
75
|
+
serviceAccount: InstanceType<typeof import("../index.js").ServiceAccount>;
|
|
76
|
+
clusterRole: InstanceType<typeof import("../index.js").ClusterRole>;
|
|
77
|
+
clusterRoleBinding: InstanceType<typeof import("../index.js").ClusterRoleBinding>;
|
|
78
|
+
configMap: InstanceType<typeof import("../index.js").ConfigMap>;
|
|
79
|
+
}>;
|
|
80
|
+
//# sourceMappingURL=otel-collector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"otel-collector.d.ts","sourceRoot":"","sources":["../../src/composites/otel-collector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAOL,KAAK,aAAa,EAClB,KAAK,MAAM,EACZ,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAA2B,KAAK,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAE/F,MAAM,WAAW,kBAAkB;IACjC,8CAA8C;IAC9C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4CAA4C;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mGAA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EF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,aAAa;;;;;;;EA0EP,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -13,8 +13,8 @@ export { microTime, isMicroTimeFormatted } from "./micro-time.js";
|
|
|
13
13
|
export { k8sManifest } from "./manifest-entity.js";
|
|
14
14
|
export type { RenderedManifestEntity } from "./manifest-entity.js";
|
|
15
15
|
export * from "./generated/index.js";
|
|
16
|
-
export { WebApp, StatefulApp, CronWorkload, AutoscaledService, WorkerPool, NamespaceEnv, NodeAgent, BatchJob, SecureIngress, ConfiguredApp, SidecarApp, MonitoredService, NetworkIsolatedApp, IrsaServiceAccount, AlbIngress, EbsStorageClass, EfsStorageClass, FluentBitAgent, ExternalDnsAgent, AdotCollector, MetricsServer, WorkloadIdentityServiceAccount, GcePdStorageClass, FilestoreStorageClass, GkeGateway, ConfigConnectorContext, GceIngress, CockroachDbCluster, CockroachDbRegionStack, RayCluster, RayJob, RayService, ArgoAppFor, ArgoAppSetForRegions, registerArgoCluster, FluxGitSource, FluxAppFor, AgicIngress, AzureDiskStorageClass, AzureFileStorageClass, AzureMonitorCollector, AksWorkloadIdentityServiceAccount, GkeFluentBitAgent, GkeOtelCollector, GkeExternalDnsAgent, AksExternalDnsAgent, Model, resolveModelStorageUri, OperatorStack, deriveHostVerbClass, DEFAULT_RESOURCE_RULES, } from "./composites/index.js";
|
|
17
|
-
export type { WebAppProps, WebAppResult, StatefulAppProps, StatefulAppResult, CronWorkloadProps, CronWorkloadResult, AutoscaledServiceProps, AutoscaledServiceResult, WorkerPoolProps, WorkerPoolResult, NamespaceEnvProps, NamespaceEnvResult, NodeAgentProps, NodeAgentResult, BatchJobProps, BatchJobResult, SecureIngressProps, SecureIngressResult, ConfiguredAppProps, ConfiguredAppResult, SidecarAppProps, SidecarAppResult, MonitoredServiceProps, MonitoredServiceResult, NetworkIsolatedAppProps, NetworkIsolatedAppResult, IrsaServiceAccountProps, IrsaServiceAccountResult, AlbIngressProps, AlbIngressResult, EbsStorageClassProps, EbsStorageClassResult, EfsStorageClassProps, EfsStorageClassResult, FluentBitAgentProps, FluentBitAgentResult, ExternalDnsAgentProps, ExternalDnsAgentResult, AdotCollectorProps, AdotCollectorResult, MetricsServerProps, MetricsServerResult, WorkloadIdentityServiceAccountProps, WorkloadIdentityServiceAccountResult, GcePdStorageClassProps, GcePdStorageClassResult, FilestoreStorageClassProps, FilestoreStorageClassResult, GkeGatewayProps, GkeGatewayResult, ConfigConnectorContextProps, ConfigConnectorContextResult, GceIngressProps, GceIngressResult, CockroachDbClusterProps, CockroachDbClusterResult, CockroachDbRegionStackConfig, CockroachDbRegionCockroachConfig, CockroachDbRegionTlsConfig, RayClusterProps, RayClusterResult, RayClusterSpec, ResourceSpec, HeadGroupSpec, WorkerGroupSpec, RayJobProps, RayJobResult, RayServiceProps, RayServiceResult, ArgoDestination, ArgoSyncPolicy, ArgoAppForOptions, ArgoAppForResult, ArgoRegionTarget, ArgoAppSetForRegionsOptions, ArgoAppSetForRegionsResult, RegisterArgoClusterOptions, RegisterArgoClusterResult, FluxSourceKind, FluxSourceRef, FluxGitSourceOptions, FluxGitSourceResult, FluxAppForOptions, FluxAppForResult, AgicIngressProps, AgicIngressResult, AzureDiskStorageClassProps, AzureDiskStorageClassResult, AzureFileStorageClassProps, AzureFileStorageClassResult, AzureMonitorCollectorProps, AzureMonitorCollectorResult, AksWorkloadIdentityServiceAccountProps, AksWorkloadIdentityServiceAccountResult, GkeFluentBitAgentProps, GkeFluentBitAgentResult, GkeOtelCollectorProps, GkeOtelCollectorResult, GkeExternalDnsAgentProps, GkeExternalDnsAgentResult, AksExternalDnsAgentProps, AksExternalDnsAgentResult, ModelSource, ModelProps, ModelResult, OperatorDial, OperatorRbacResourceRule, OperatorStackConvergeHost, OperatorStackConfig, OperatorStackResult, } from "./composites/index.js";
|
|
16
|
+
export { WebApp, StatefulApp, CronWorkload, AutoscaledService, WorkerPool, NamespaceEnv, NodeAgent, BatchJob, SecureIngress, ConfiguredApp, SidecarApp, MonitoredService, NetworkIsolatedApp, IrsaServiceAccount, AlbIngress, EbsStorageClass, EfsStorageClass, FluentBitAgent, ExternalDnsAgent, AdotCollector, OtelCollector, MetricsServer, WorkloadIdentityServiceAccount, GcePdStorageClass, FilestoreStorageClass, GkeGateway, ConfigConnectorContext, GceIngress, CockroachDbCluster, CockroachDbRegionStack, RayCluster, RayJob, RayService, ArgoAppFor, ArgoAppSetForRegions, registerArgoCluster, FluxGitSource, FluxAppFor, AgicIngress, AzureDiskStorageClass, AzureFileStorageClass, AzureMonitorCollector, AksWorkloadIdentityServiceAccount, GkeFluentBitAgent, GkeOtelCollector, GkeExternalDnsAgent, AksExternalDnsAgent, Model, resolveModelStorageUri, OperatorStack, deriveHostVerbClass, DEFAULT_RESOURCE_RULES, } from "./composites/index.js";
|
|
17
|
+
export type { WebAppProps, WebAppResult, StatefulAppProps, StatefulAppResult, CronWorkloadProps, CronWorkloadResult, AutoscaledServiceProps, AutoscaledServiceResult, WorkerPoolProps, WorkerPoolResult, NamespaceEnvProps, NamespaceEnvResult, NodeAgentProps, NodeAgentResult, BatchJobProps, BatchJobResult, SecureIngressProps, SecureIngressResult, ConfiguredAppProps, ConfiguredAppResult, SidecarAppProps, SidecarAppResult, MonitoredServiceProps, MonitoredServiceResult, NetworkIsolatedAppProps, NetworkIsolatedAppResult, IrsaServiceAccountProps, IrsaServiceAccountResult, AlbIngressProps, AlbIngressResult, EbsStorageClassProps, EbsStorageClassResult, EfsStorageClassProps, EfsStorageClassResult, FluentBitAgentProps, FluentBitAgentResult, ExternalDnsAgentProps, ExternalDnsAgentResult, AdotCollectorProps, AdotCollectorResult, OtelCollectorProps, OtelCollectorResult, MetricsServerProps, MetricsServerResult, WorkloadIdentityServiceAccountProps, WorkloadIdentityServiceAccountResult, GcePdStorageClassProps, GcePdStorageClassResult, FilestoreStorageClassProps, FilestoreStorageClassResult, GkeGatewayProps, GkeGatewayResult, ConfigConnectorContextProps, ConfigConnectorContextResult, GceIngressProps, GceIngressResult, CockroachDbClusterProps, CockroachDbClusterResult, CockroachDbRegionStackConfig, CockroachDbRegionCockroachConfig, CockroachDbRegionTlsConfig, RayClusterProps, RayClusterResult, RayClusterSpec, ResourceSpec, HeadGroupSpec, WorkerGroupSpec, RayJobProps, RayJobResult, RayServiceProps, RayServiceResult, ArgoDestination, ArgoSyncPolicy, ArgoAppForOptions, ArgoAppForResult, ArgoRegionTarget, ArgoAppSetForRegionsOptions, ArgoAppSetForRegionsResult, RegisterArgoClusterOptions, RegisterArgoClusterResult, FluxSourceKind, FluxSourceRef, FluxGitSourceOptions, FluxGitSourceResult, FluxAppForOptions, FluxAppForResult, AgicIngressProps, AgicIngressResult, AzureDiskStorageClassProps, AzureDiskStorageClassResult, AzureFileStorageClassProps, AzureFileStorageClassResult, AzureMonitorCollectorProps, AzureMonitorCollectorResult, AksWorkloadIdentityServiceAccountProps, AksWorkloadIdentityServiceAccountResult, GkeFluentBitAgentProps, GkeFluentBitAgentResult, GkeOtelCollectorProps, GkeOtelCollectorResult, GkeExternalDnsAgentProps, GkeExternalDnsAgentResult, AksExternalDnsAgentProps, AksExternalDnsAgentResult, ModelSource, ModelProps, ModelResult, OperatorDial, OperatorRbacResourceRule, OperatorStackConvergeHost, OperatorStackConfig, OperatorStackResult, } from "./composites/index.js";
|
|
18
18
|
export * from "./actions/index.js";
|
|
19
19
|
export { fetchK8sSchema, fetchSchemas, K8S_SCHEMA_VERSION } from "./spec/fetch.js";
|
|
20
20
|
export { parseK8sSwagger, k8sShortName, k8sServiceName, gvkToTypeName, gvkToApiVersion } from "./spec/parse.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAcrC,OAAO,EAAE,mBAAmB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c,EAAE,YAAY,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC7G,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAE,kBAAkB,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAGrI,OAAO,EAAE,QAAQ,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,YAAY,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAGvE,YAAY,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAG1D,YAAY,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC"}
|
package/dist/integrity.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"algorithm": "sha256",
|
|
3
3
|
"artifacts": {
|
|
4
|
-
"manifest.json": "
|
|
4
|
+
"manifest.json": "5ab38d8e87cfd565155cc1934a0dc871c420244720d67bd1c9c554d2fee513dc",
|
|
5
5
|
"meta.json": "8b999bc142f448b0b627ecdc9e2388bbe672c8a1f7aae5303135624cf2fe65e3",
|
|
6
6
|
"types/index.d.ts": "5f67de738adb455805e72600948940af9c664283785fb68c9fd8f5ea90d42cc3",
|
|
7
7
|
"rules/argo-appset-single-project.ts": "afa9f310753aa2d475f35012b13135b2dfaebed2a35d44edbe185ebc07673674",
|
|
@@ -65,5 +65,5 @@
|
|
|
65
65
|
"skills/chant-k8s-argo.md": "24c9a85b78a2fc5c6657424baac9cc6d6caff6f47605b8146b2c0082133181cf",
|
|
66
66
|
"skills/chant-k8s-flux.md": "9670efc2e9854bd14686b5adeb707396b9030a4dcaee6529b30abf56efe2c50c"
|
|
67
67
|
},
|
|
68
|
-
"composite": "
|
|
68
|
+
"composite": "85f31a3065afd2cf82c81a0539e853d1bcfccc5ce3a67b6c23240fc00bfd696f"
|
|
69
69
|
}
|
package/dist/manifest.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@intentius/chant-lexicon-k8s",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.82.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",
|
|
@@ -72,11 +72,12 @@
|
|
|
72
72
|
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && find dist -type f \\( -name \"*.js\" -o -name \"*.js.map\" \\) -delete"
|
|
73
73
|
},
|
|
74
74
|
"dependencies": {
|
|
75
|
+
"@intentius/chant-lexicon-otel": "*",
|
|
75
76
|
"js-yaml": "^4.3.1",
|
|
76
77
|
"@types/js-yaml": "^4.0.9"
|
|
77
78
|
},
|
|
78
79
|
"optionalDependencies": {
|
|
79
|
-
"@intentius/chant-k8s-client": "^0.
|
|
80
|
+
"@intentius/chant-k8s-client": "^0.82.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
82
83
|
"@intentius/chant": "*",
|
|
@@ -84,7 +85,7 @@
|
|
|
84
85
|
},
|
|
85
86
|
"peerDependencies": {
|
|
86
87
|
"zod": "^4.3.6",
|
|
87
|
-
"@intentius/chant": "^0.
|
|
88
|
+
"@intentius/chant": "^0.82.0",
|
|
88
89
|
"typescript": "^5.9.3"
|
|
89
90
|
}
|
|
90
91
|
}
|
|
@@ -2955,6 +2955,181 @@ describe("GkeOtelCollector", () => {
|
|
|
2955
2955
|
expect((p(resource).metadata as any).labels["app.kubernetes.io/managed-by"]).toBe("chant");
|
|
2956
2956
|
}
|
|
2957
2957
|
});
|
|
2958
|
+
|
|
2959
|
+
// #2559 moved the collector config onto the otel lexicon. This is the
|
|
2960
|
+
// hand-written template the composite carried before, verbatim; the
|
|
2961
|
+
// lexicon-rendered config must match it byte for byte.
|
|
2962
|
+
const handWrittenConfig = (projectId: string, clusterName: string) => `receivers:
|
|
2963
|
+
otlp:
|
|
2964
|
+
protocols:
|
|
2965
|
+
grpc:
|
|
2966
|
+
endpoint: 0.0.0.0:4317
|
|
2967
|
+
http:
|
|
2968
|
+
endpoint: 0.0.0.0:4318
|
|
2969
|
+
|
|
2970
|
+
processors:
|
|
2971
|
+
batch:
|
|
2972
|
+
timeout: 30s
|
|
2973
|
+
send_batch_size: 8192
|
|
2974
|
+
resourcedetection:
|
|
2975
|
+
detectors: [gcp]
|
|
2976
|
+
timeout: 10s
|
|
2977
|
+
|
|
2978
|
+
exporters:
|
|
2979
|
+
googlecloud:
|
|
2980
|
+
project: ${projectId}
|
|
2981
|
+
metric:
|
|
2982
|
+
prefix: custom.googleapis.com/${clusterName}
|
|
2983
|
+
trace:
|
|
2984
|
+
attribute_mappings:
|
|
2985
|
+
- key: service.name
|
|
2986
|
+
replacement: g.co/r/service/name
|
|
2987
|
+
|
|
2988
|
+
service:
|
|
2989
|
+
pipelines:
|
|
2990
|
+
metrics:
|
|
2991
|
+
receivers: [otlp]
|
|
2992
|
+
processors: [batch, resourcedetection]
|
|
2993
|
+
exporters: [googlecloud]
|
|
2994
|
+
traces:
|
|
2995
|
+
receivers: [otlp]
|
|
2996
|
+
processors: [batch, resourcedetection]
|
|
2997
|
+
exporters: [googlecloud]
|
|
2998
|
+
`;
|
|
2999
|
+
|
|
3000
|
+
test.each([
|
|
3001
|
+
["test-project", "test-cluster"],
|
|
3002
|
+
["my-project", "gke-microservice"],
|
|
3003
|
+
["p-123456", "c1"],
|
|
3004
|
+
])("config.yaml is byte-identical to the pre-lexicon template (%s, %s)", (projectId, clusterName) => {
|
|
3005
|
+
const result = GkeOtelCollector({ clusterName, projectId });
|
|
3006
|
+
expect((p(result.configMap).data as any)["config.yaml"]).toBe(handWrittenConfig(projectId, clusterName));
|
|
3007
|
+
});
|
|
3008
|
+
|
|
3009
|
+
test("the rendered config passes the otel lexicon's checks", async () => {
|
|
3010
|
+
const { validateCollectorConfig } = await import("@intentius/chant-lexicon-otel");
|
|
3011
|
+
const { load } = await import("js-yaml");
|
|
3012
|
+
const result = GkeOtelCollector(minProps);
|
|
3013
|
+
const config = load((p(result.configMap).data as any)["config.yaml"]) as any;
|
|
3014
|
+
expect(validateCollectorConfig(config)).toEqual([]);
|
|
3015
|
+
});
|
|
3016
|
+
});
|
|
3017
|
+
|
|
3018
|
+
// ── OtelCollector ────────────────────────────────────────────────────
|
|
3019
|
+
|
|
3020
|
+
describe("OtelCollector", () => {
|
|
3021
|
+
const { OtelCollector } = require("./otel-collector");
|
|
3022
|
+
|
|
3023
|
+
async function renderedConfig(result: any): Promise<any> {
|
|
3024
|
+
const { load } = await import("js-yaml");
|
|
3025
|
+
return load((p(result.configMap).data as any)["config.yaml"]);
|
|
3026
|
+
}
|
|
3027
|
+
|
|
3028
|
+
test("returns the agent resources and a Service", () => {
|
|
3029
|
+
const result = OtelCollector({});
|
|
3030
|
+
for (const key of ["daemonSet", "service", "serviceAccount", "clusterRole", "clusterRoleBinding", "configMap"]) {
|
|
3031
|
+
expect(result[key], key).toBeDefined();
|
|
3032
|
+
}
|
|
3033
|
+
});
|
|
3034
|
+
|
|
3035
|
+
test("defaults to otel-collector in observability, on the pinned contrib image", async () => {
|
|
3036
|
+
const { COLLECTOR_IMAGE } = await import("@intentius/chant-lexicon-otel");
|
|
3037
|
+
const result = OtelCollector({});
|
|
3038
|
+
const meta = p(result.daemonSet).metadata as any;
|
|
3039
|
+
expect(meta.name).toBe("otel-collector");
|
|
3040
|
+
expect(meta.namespace).toBe("observability");
|
|
3041
|
+
const container = (p(result.daemonSet) as any).spec.template.spec.containers[0];
|
|
3042
|
+
expect(container.image).toBe(COLLECTOR_IMAGE);
|
|
3043
|
+
expect(container.image).toMatch(/^otel\/opentelemetry-collector-contrib:\d+\.\d+\.\d+$/);
|
|
3044
|
+
});
|
|
3045
|
+
|
|
3046
|
+
test("the default config is OTLP in, debug out, and passes the otel lexicon's checks", async () => {
|
|
3047
|
+
const { validateCollectorConfig } = await import("@intentius/chant-lexicon-otel");
|
|
3048
|
+
const config = await renderedConfig(OtelCollector({}));
|
|
3049
|
+
expect(validateCollectorConfig(config)).toEqual([]);
|
|
3050
|
+
expect(Object.keys(config.exporters)).toEqual(["debug"]);
|
|
3051
|
+
expect(Object.keys(config.service.pipelines).sort()).toEqual(["logs", "metrics", "traces"]);
|
|
3052
|
+
expect(config.service.extensions).toEqual(["health_check"]);
|
|
3053
|
+
});
|
|
3054
|
+
|
|
3055
|
+
test("container and Service ports follow the config's receivers", () => {
|
|
3056
|
+
const result = OtelCollector({});
|
|
3057
|
+
const container = (p(result.daemonSet) as any).spec.template.spec.containers[0];
|
|
3058
|
+
expect(container.ports).toEqual([
|
|
3059
|
+
{ containerPort: 4317, name: "otlp-grpc" },
|
|
3060
|
+
{ containerPort: 4318, name: "otlp-http" },
|
|
3061
|
+
{ containerPort: 13133, name: "health" },
|
|
3062
|
+
]);
|
|
3063
|
+
const spec = p(result.service).spec as any;
|
|
3064
|
+
expect(spec.internalTrafficPolicy).toBe("Local");
|
|
3065
|
+
expect(spec.ports).toEqual([
|
|
3066
|
+
{ name: "otlp-grpc", port: 4317, targetPort: "otlp-grpc", protocol: "TCP" },
|
|
3067
|
+
{ name: "otlp-http", port: 4318, targetPort: "otlp-http", protocol: "TCP" },
|
|
3068
|
+
]);
|
|
3069
|
+
});
|
|
3070
|
+
|
|
3071
|
+
test("probes hit the health_check extension", () => {
|
|
3072
|
+
const container = (p(OtelCollector({}).daemonSet) as any).spec.template.spec.containers[0];
|
|
3073
|
+
expect(container.livenessProbe).toEqual({ httpGet: { path: "/", port: "health" } });
|
|
3074
|
+
expect(container.readinessProbe).toEqual(container.livenessProbe);
|
|
3075
|
+
});
|
|
3076
|
+
|
|
3077
|
+
test("the config file is mounted at the path the command reads", async () => {
|
|
3078
|
+
const { COLLECTOR_CONFIG_PATH } = await import("@intentius/chant-lexicon-otel");
|
|
3079
|
+
const pod = (p(OtelCollector({}).daemonSet) as any).spec.template.spec;
|
|
3080
|
+
const container = pod.containers[0];
|
|
3081
|
+
expect(container.args ?? container.command).toContain(`--config=${COLLECTOR_CONFIG_PATH}`);
|
|
3082
|
+
const dir = COLLECTOR_CONFIG_PATH.slice(0, COLLECTOR_CONFIG_PATH.lastIndexOf("/"));
|
|
3083
|
+
expect(container.volumeMounts.map((m: any) => m.mountPath)).toContain(dir);
|
|
3084
|
+
});
|
|
3085
|
+
|
|
3086
|
+
test("exporters and signals shape the default config", async () => {
|
|
3087
|
+
const { OtlpExporter } = await import("@intentius/chant-lexicon-otel");
|
|
3088
|
+
const tempo = new OtlpExporter({ name: "tempo", endpoint: "tempo:4317", tls: { insecure: true } });
|
|
3089
|
+
const config = await renderedConfig(OtelCollector({ exporters: [tempo], signals: ["traces"] }));
|
|
3090
|
+
expect(config.exporters).toEqual({ "otlp/tempo": { endpoint: "tempo:4317", tls: { insecure: true } } });
|
|
3091
|
+
expect(Object.keys(config.service.pipelines)).toEqual(["traces"]);
|
|
3092
|
+
expect(config.service.pipelines.traces.exporters).toEqual(["otlp/tempo"]);
|
|
3093
|
+
});
|
|
3094
|
+
|
|
3095
|
+
test("a full config replaces the default, and ports and probes follow it", async () => {
|
|
3096
|
+
const { OtlpReceiver, DebugExporter, Pipeline } = await import("@intentius/chant-lexicon-otel");
|
|
3097
|
+
const otlp = new OtlpReceiver({ protocols: { grpc: { endpoint: "0.0.0.0:14317" } } });
|
|
3098
|
+
const result = OtelCollector({
|
|
3099
|
+
config: [new Pipeline({ signal: "logs", receivers: [otlp], exporters: [new DebugExporter({})] })],
|
|
3100
|
+
});
|
|
3101
|
+
const config = await renderedConfig(result);
|
|
3102
|
+
expect(Object.keys(config.receivers)).toEqual(["otlp"]);
|
|
3103
|
+
expect(config.service.extensions).toBeUndefined();
|
|
3104
|
+
const container = (p(result.daemonSet) as any).spec.template.spec.containers[0];
|
|
3105
|
+
expect(container.ports).toEqual([{ containerPort: 14317, name: "otlp-grpc" }]);
|
|
3106
|
+
expect(container.livenessProbe).toBeUndefined();
|
|
3107
|
+
expect((p(result.service).spec as any).ports.map((x: any) => x.port)).toEqual([14317]);
|
|
3108
|
+
});
|
|
3109
|
+
|
|
3110
|
+
test("name, namespace and labels reach every resource", () => {
|
|
3111
|
+
const result = OtelCollector({ name: "agent", namespace: "telemetry", labels: { team: "obs" } });
|
|
3112
|
+
for (const key of ["daemonSet", "service", "serviceAccount", "configMap"]) {
|
|
3113
|
+
const meta = p(result[key]).metadata as any;
|
|
3114
|
+
expect(meta.name, key).toMatch(/^agent(-|$)/);
|
|
3115
|
+
expect(meta.namespace, key).toBe("telemetry");
|
|
3116
|
+
expect(meta.labels.team, key).toBe("obs");
|
|
3117
|
+
expect(meta.labels["app.kubernetes.io/managed-by"], key).toBe("chant");
|
|
3118
|
+
}
|
|
3119
|
+
expect((p(result.service).spec as any).selector).toEqual({ "app.kubernetes.io/name": "agent" });
|
|
3120
|
+
});
|
|
3121
|
+
|
|
3122
|
+
test("defaults override a member", () => {
|
|
3123
|
+
const result = OtelCollector({ defaults: { service: { spec: { internalTrafficPolicy: "Cluster" } } } });
|
|
3124
|
+
expect((p(result.service).spec as any).internalTrafficPolicy).toBe("Cluster");
|
|
3125
|
+
});
|
|
3126
|
+
|
|
3127
|
+
test("container runs as non-root with a read-only root filesystem", () => {
|
|
3128
|
+
const container = (p(OtelCollector({}).daemonSet) as any).spec.template.spec.containers[0];
|
|
3129
|
+
expect(container.securityContext.runAsNonRoot).toBe(true);
|
|
3130
|
+
expect(container.securityContext.readOnlyRootFilesystem).toBe(true);
|
|
3131
|
+
expect(container.securityContext.capabilities).toEqual({ drop: ["ALL"] });
|
|
3132
|
+
});
|
|
2958
3133
|
});
|
|
2959
3134
|
|
|
2960
3135
|
// ── GkeExternalDnsAgent ──────────────────────────────────────────────
|
|
@@ -3,10 +3,22 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @gke Like AdotCollector but targets Cloud Trace + Cloud Monitoring via the
|
|
5
5
|
* googlecloud exporter and uses GKE Workload Identity instead of IRSA.
|
|
6
|
+
*
|
|
7
|
+
* The collector config is typed through the otel lexicon
|
|
8
|
+
* (`@intentius/chant-lexicon-otel`) and rendered with its `collectorYaml`, so
|
|
9
|
+
* it is checked the way any declared collector config is.
|
|
6
10
|
*/
|
|
7
11
|
|
|
8
|
-
import { Composite
|
|
9
|
-
import {
|
|
12
|
+
import { Composite } from "@intentius/chant";
|
|
13
|
+
import {
|
|
14
|
+
OtlpReceiver,
|
|
15
|
+
BatchProcessor,
|
|
16
|
+
ResourceDetectionProcessor,
|
|
17
|
+
GoogleCloudExporter,
|
|
18
|
+
Pipeline,
|
|
19
|
+
collectorYaml,
|
|
20
|
+
} from "@intentius/chant-lexicon-otel";
|
|
21
|
+
import { collectorAgentResources, type CollectorAgentResources } from "./otel-collector-agent";
|
|
10
22
|
|
|
11
23
|
export interface GkeOtelCollectorProps {
|
|
12
24
|
/** GKE cluster name. */
|
|
@@ -41,13 +53,7 @@ export interface GkeOtelCollectorProps {
|
|
|
41
53
|
};
|
|
42
54
|
}
|
|
43
55
|
|
|
44
|
-
export
|
|
45
|
-
daemonSet: InstanceType<typeof DaemonSet>;
|
|
46
|
-
serviceAccount: InstanceType<typeof ServiceAccount>;
|
|
47
|
-
clusterRole: InstanceType<typeof ClusterRole>;
|
|
48
|
-
clusterRoleBinding: InstanceType<typeof ClusterRoleBinding>;
|
|
49
|
-
configMap: InstanceType<typeof ConfigMap>;
|
|
50
|
-
}
|
|
56
|
+
export type GkeOtelCollectorResult = CollectorAgentResources;
|
|
51
57
|
|
|
52
58
|
/**
|
|
53
59
|
* Create a GkeOtelCollector composite — returns prop objects for
|
|
@@ -81,161 +87,58 @@ export const GkeOtelCollector = Composite((props: GkeOtelCollectorProps) => {
|
|
|
81
87
|
defaults: defs,
|
|
82
88
|
} = props;
|
|
83
89
|
|
|
84
|
-
const saName = `${name}-sa`;
|
|
85
|
-
const clusterRoleName = `${name}-role`;
|
|
86
|
-
const bindingName = `${name}-binding`;
|
|
87
|
-
const configMapName = `${name}-config`;
|
|
88
|
-
|
|
89
90
|
const commonLabels: Record<string, string> = {
|
|
90
91
|
"app.kubernetes.io/name": name,
|
|
91
92
|
"app.kubernetes.io/managed-by": "chant",
|
|
92
93
|
...extraLabels,
|
|
93
94
|
};
|
|
94
95
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
http:
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
metrics:
|
|
124
|
-
receivers: [otlp]
|
|
125
|
-
processors: [batch, resourcedetection]
|
|
126
|
-
exporters: [googlecloud]
|
|
127
|
-
traces:
|
|
128
|
-
receivers: [otlp]
|
|
129
|
-
processors: [batch, resourcedetection]
|
|
130
|
-
exporters: [googlecloud]
|
|
131
|
-
`;
|
|
132
|
-
|
|
133
|
-
const container: Record<string, unknown> = {
|
|
96
|
+
// The collector config, declared through the otel lexicon and rendered to
|
|
97
|
+
// the same YAML the ConfigMap has always carried (#2559).
|
|
98
|
+
const otlp = new OtlpReceiver({
|
|
99
|
+
protocols: {
|
|
100
|
+
grpc: { endpoint: "0.0.0.0:4317" },
|
|
101
|
+
http: { endpoint: "0.0.0.0:4318" },
|
|
102
|
+
},
|
|
103
|
+
});
|
|
104
|
+
const batch = new BatchProcessor({ timeout: "30s", send_batch_size: 8192 });
|
|
105
|
+
const resourceDetection = new ResourceDetectionProcessor({ detectors: ["gcp"], timeout: "10s" });
|
|
106
|
+
const googleCloud = new GoogleCloudExporter({
|
|
107
|
+
project: projectId,
|
|
108
|
+
metric: { prefix: `custom.googleapis.com/${clusterName}` },
|
|
109
|
+
trace: {
|
|
110
|
+
attribute_mappings: [{ key: "service.name", replacement: "g.co/r/service/name" }],
|
|
111
|
+
},
|
|
112
|
+
});
|
|
113
|
+
const otelConfig = collectorYaml([
|
|
114
|
+
otlp,
|
|
115
|
+
batch,
|
|
116
|
+
resourceDetection,
|
|
117
|
+
googleCloud,
|
|
118
|
+
new Pipeline({ signal: "metrics", receivers: [otlp], processors: [batch, resourceDetection], exporters: [googleCloud] }),
|
|
119
|
+
new Pipeline({ signal: "traces", receivers: [otlp], processors: [batch, resourceDetection], exporters: [googleCloud] }),
|
|
120
|
+
]);
|
|
121
|
+
|
|
122
|
+
// The DaemonSet, RBAC and ConfigMap are the ones OtelCollector builds too.
|
|
123
|
+
return collectorAgentResources({
|
|
134
124
|
name,
|
|
125
|
+
namespace,
|
|
135
126
|
image,
|
|
136
|
-
|
|
127
|
+
commonLabels,
|
|
128
|
+
extraLabels,
|
|
129
|
+
configYaml: otelConfig,
|
|
130
|
+
configDir: "/etc/otel",
|
|
137
131
|
ports: [
|
|
138
132
|
{ containerPort: 4317, name: "otlp-grpc" },
|
|
139
133
|
{ containerPort: 4318, name: "otlp-http" },
|
|
140
134
|
],
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
{
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
runAsUser: 10001,
|
|
151
|
-
readOnlyRootFilesystem: true,
|
|
152
|
-
allowPrivilegeEscalation: false,
|
|
153
|
-
},
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
const daemonSet = new DaemonSet(mergeDefaults({
|
|
157
|
-
metadata: {
|
|
158
|
-
name,
|
|
159
|
-
namespace,
|
|
160
|
-
labels: { ...commonLabels, "app.kubernetes.io/component": "agent" },
|
|
161
|
-
},
|
|
162
|
-
spec: {
|
|
163
|
-
selector: { matchLabels: { "app.kubernetes.io/name": name } },
|
|
164
|
-
template: {
|
|
165
|
-
metadata: { labels: { "app.kubernetes.io/name": name, ...extraLabels } },
|
|
166
|
-
spec: {
|
|
167
|
-
serviceAccountName: saName,
|
|
168
|
-
containers: [container],
|
|
169
|
-
volumes: [
|
|
170
|
-
{ name: "config", configMap: { name: configMapName } },
|
|
171
|
-
],
|
|
172
|
-
tolerations: [{ operator: "Exists" }],
|
|
173
|
-
},
|
|
174
|
-
},
|
|
175
|
-
},
|
|
176
|
-
}, defs?.daemonSet));
|
|
177
|
-
|
|
178
|
-
const serviceAccount = new ServiceAccount(mergeDefaults({
|
|
179
|
-
metadata: {
|
|
180
|
-
name: saName,
|
|
181
|
-
namespace,
|
|
182
|
-
labels: { ...commonLabels, "app.kubernetes.io/component": "agent" },
|
|
183
|
-
...(gcpServiceAccountEmail
|
|
184
|
-
? { annotations: { "iam.gke.io/gcp-service-account": gcpServiceAccountEmail } }
|
|
185
|
-
: {}),
|
|
186
|
-
},
|
|
187
|
-
}, defs?.serviceAccount));
|
|
188
|
-
|
|
189
|
-
const clusterRole = new ClusterRole(mergeDefaults({
|
|
190
|
-
metadata: {
|
|
191
|
-
name: clusterRoleName,
|
|
192
|
-
labels: { ...commonLabels, "app.kubernetes.io/component": "rbac" },
|
|
193
|
-
},
|
|
194
|
-
rules: [
|
|
195
|
-
{ apiGroups: [""], resources: ["pods", "nodes", "endpoints"], verbs: ["get", "list", "watch"] },
|
|
196
|
-
{ apiGroups: ["apps"], resources: ["replicasets"], verbs: ["get", "list", "watch"] },
|
|
197
|
-
{ apiGroups: ["batch"], resources: ["jobs"], verbs: ["get", "list", "watch"] },
|
|
198
|
-
{ apiGroups: [""], resources: ["nodes/proxy"], verbs: ["get"] },
|
|
199
|
-
{ apiGroups: [""], resources: ["nodes/stats", "configmaps", "events"], verbs: ["create", "get"] },
|
|
200
|
-
{ apiGroups: [""], resources: ["configmaps"], verbs: ["get", "update", "create"], resourceNames: ["otel-container-insight-clusterleader"] },
|
|
201
|
-
],
|
|
202
|
-
}, defs?.clusterRole));
|
|
203
|
-
|
|
204
|
-
const clusterRoleBinding = new ClusterRoleBinding(mergeDefaults({
|
|
205
|
-
metadata: {
|
|
206
|
-
name: bindingName,
|
|
207
|
-
labels: { ...commonLabels, "app.kubernetes.io/component": "rbac" },
|
|
208
|
-
},
|
|
209
|
-
roleRef: {
|
|
210
|
-
apiGroup: "rbac.authorization.k8s.io",
|
|
211
|
-
kind: "ClusterRole",
|
|
212
|
-
name: clusterRoleName,
|
|
213
|
-
},
|
|
214
|
-
subjects: [
|
|
215
|
-
{
|
|
216
|
-
kind: "ServiceAccount",
|
|
217
|
-
name: saName,
|
|
218
|
-
namespace,
|
|
219
|
-
},
|
|
220
|
-
],
|
|
221
|
-
}, defs?.clusterRoleBinding));
|
|
222
|
-
|
|
223
|
-
const configMap = new ConfigMap(mergeDefaults({
|
|
224
|
-
metadata: {
|
|
225
|
-
name: configMapName,
|
|
226
|
-
namespace,
|
|
227
|
-
labels: { ...commonLabels, "app.kubernetes.io/component": "config" },
|
|
228
|
-
},
|
|
229
|
-
data: {
|
|
230
|
-
"config.yaml": otelConfig,
|
|
231
|
-
},
|
|
232
|
-
}, defs?.configMap));
|
|
233
|
-
|
|
234
|
-
return {
|
|
235
|
-
daemonSet,
|
|
236
|
-
serviceAccount,
|
|
237
|
-
clusterRole,
|
|
238
|
-
clusterRoleBinding,
|
|
239
|
-
configMap,
|
|
240
|
-
};
|
|
135
|
+
cpuRequest,
|
|
136
|
+
memoryRequest,
|
|
137
|
+
cpuLimit,
|
|
138
|
+
memoryLimit,
|
|
139
|
+
...(gcpServiceAccountEmail
|
|
140
|
+
? { serviceAccountAnnotations: { "iam.gke.io/gcp-service-account": gcpServiceAccountEmail } }
|
|
141
|
+
: {}),
|
|
142
|
+
defaults: defs,
|
|
143
|
+
});
|
|
241
144
|
}, "GkeOtelCollector");
|
package/src/composites/index.ts
CHANGED
|
@@ -65,6 +65,8 @@ export { WorkloadIdentityServiceAccount as AksWorkloadIdentityServiceAccount } f
|
|
|
65
65
|
export type { WorkloadIdentityServiceAccountProps as AksWorkloadIdentityServiceAccountProps, WorkloadIdentityServiceAccountResult as AksWorkloadIdentityServiceAccountResult } from "./workload-identity-sa";
|
|
66
66
|
export { GkeFluentBitAgent } from "./gke-fluent-bit-agent";
|
|
67
67
|
export type { GkeFluentBitAgentProps, GkeFluentBitAgentResult } from "./gke-fluent-bit-agent";
|
|
68
|
+
export { OtelCollector } from "./otel-collector";
|
|
69
|
+
export type { OtelCollectorProps, OtelCollectorResult } from "./otel-collector";
|
|
68
70
|
export { GkeOtelCollector } from "./gke-otel-collector";
|
|
69
71
|
export type { GkeOtelCollectorProps, GkeOtelCollectorResult } from "./gke-otel-collector";
|
|
70
72
|
export { GkeExternalDnsAgent } from "./gke-external-dns-agent";
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The Kubernetes resources an OpenTelemetry Collector agent needs, shared by
|
|
3
|
+
* `OtelCollector` and `GkeOtelCollector`: a DaemonSet running the collector
|
|
4
|
+
* with its config mounted from a ConfigMap, and a ServiceAccount bound to a
|
|
5
|
+
* ClusterRole that reads pods, nodes and workloads.
|
|
6
|
+
*
|
|
7
|
+
* The caller renders the collector config (with the otel lexicon's
|
|
8
|
+
* `collectorYaml`) and says which ports the container exposes. Everything
|
|
9
|
+
* platform-specific, such as a Workload Identity annotation or probes, comes
|
|
10
|
+
* in as an option, so each composite keeps its own output.
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { mergeDefaults } from "@intentius/chant";
|
|
14
|
+
import { DaemonSet, ServiceAccount, ClusterRole, ClusterRoleBinding, ConfigMap } from "../generated";
|
|
15
|
+
|
|
16
|
+
export interface CollectorAgentOptions {
|
|
17
|
+
name: string;
|
|
18
|
+
namespace: string;
|
|
19
|
+
image: string;
|
|
20
|
+
/** Labels on every resource, and (with `extraLabels`) on the pod template. */
|
|
21
|
+
commonLabels: Record<string, string>;
|
|
22
|
+
/** Labels the caller added, repeated on the pod template. */
|
|
23
|
+
extraLabels: Record<string, string>;
|
|
24
|
+
/** The rendered collector config, stored under `config.yaml`. */
|
|
25
|
+
configYaml: string;
|
|
26
|
+
/** Directory the config is mounted in. The file is `<dir>/config.yaml`. */
|
|
27
|
+
configDir: string;
|
|
28
|
+
ports: Array<{ containerPort: number; name: string }>;
|
|
29
|
+
cpuRequest: string;
|
|
30
|
+
memoryRequest: string;
|
|
31
|
+
cpuLimit: string;
|
|
32
|
+
memoryLimit: string;
|
|
33
|
+
/** Extra container fields, such as probes. Added after the standard ones. */
|
|
34
|
+
containerExtra?: Record<string, unknown>;
|
|
35
|
+
/** Annotations on the ServiceAccount, such as a cloud identity binding. */
|
|
36
|
+
serviceAccountAnnotations?: Record<string, string>;
|
|
37
|
+
defaults?: {
|
|
38
|
+
daemonSet?: Partial<Record<string, unknown>>;
|
|
39
|
+
serviceAccount?: Partial<Record<string, unknown>>;
|
|
40
|
+
clusterRole?: Partial<Record<string, unknown>>;
|
|
41
|
+
clusterRoleBinding?: Partial<Record<string, unknown>>;
|
|
42
|
+
configMap?: Partial<Record<string, unknown>>;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export type CollectorAgentResources = {
|
|
47
|
+
daemonSet: InstanceType<typeof DaemonSet>;
|
|
48
|
+
serviceAccount: InstanceType<typeof ServiceAccount>;
|
|
49
|
+
clusterRole: InstanceType<typeof ClusterRole>;
|
|
50
|
+
clusterRoleBinding: InstanceType<typeof ClusterRoleBinding>;
|
|
51
|
+
configMap: InstanceType<typeof ConfigMap>;
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export function collectorAgentResources(opts: CollectorAgentOptions): CollectorAgentResources {
|
|
55
|
+
const { name, namespace, commonLabels, extraLabels, defaults: defs } = opts;
|
|
56
|
+
const saName = `${name}-sa`;
|
|
57
|
+
const clusterRoleName = `${name}-role`;
|
|
58
|
+
const bindingName = `${name}-binding`;
|
|
59
|
+
const configMapName = `${name}-config`;
|
|
60
|
+
|
|
61
|
+
const container: Record<string, unknown> = {
|
|
62
|
+
name,
|
|
63
|
+
image: opts.image,
|
|
64
|
+
args: [`--config=${opts.configDir}/config.yaml`],
|
|
65
|
+
ports: opts.ports,
|
|
66
|
+
resources: {
|
|
67
|
+
requests: { cpu: opts.cpuRequest, memory: opts.memoryRequest },
|
|
68
|
+
limits: { cpu: opts.cpuLimit, memory: opts.memoryLimit },
|
|
69
|
+
},
|
|
70
|
+
volumeMounts: [
|
|
71
|
+
{ name: "config", mountPath: opts.configDir, readOnly: true },
|
|
72
|
+
],
|
|
73
|
+
securityContext: {
|
|
74
|
+
runAsNonRoot: true,
|
|
75
|
+
runAsUser: 10001,
|
|
76
|
+
readOnlyRootFilesystem: true,
|
|
77
|
+
allowPrivilegeEscalation: false,
|
|
78
|
+
},
|
|
79
|
+
...opts.containerExtra,
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
const daemonSet = new DaemonSet(mergeDefaults({
|
|
83
|
+
metadata: {
|
|
84
|
+
name,
|
|
85
|
+
namespace,
|
|
86
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "agent" },
|
|
87
|
+
},
|
|
88
|
+
spec: {
|
|
89
|
+
selector: { matchLabels: { "app.kubernetes.io/name": name } },
|
|
90
|
+
template: {
|
|
91
|
+
metadata: { labels: { "app.kubernetes.io/name": name, ...extraLabels } },
|
|
92
|
+
spec: {
|
|
93
|
+
serviceAccountName: saName,
|
|
94
|
+
containers: [container],
|
|
95
|
+
volumes: [
|
|
96
|
+
{ name: "config", configMap: { name: configMapName } },
|
|
97
|
+
],
|
|
98
|
+
tolerations: [{ operator: "Exists" }],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
}, defs?.daemonSet));
|
|
103
|
+
|
|
104
|
+
const serviceAccount = new ServiceAccount(mergeDefaults({
|
|
105
|
+
metadata: {
|
|
106
|
+
name: saName,
|
|
107
|
+
namespace,
|
|
108
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "agent" },
|
|
109
|
+
...(opts.serviceAccountAnnotations ? { annotations: opts.serviceAccountAnnotations } : {}),
|
|
110
|
+
},
|
|
111
|
+
}, defs?.serviceAccount));
|
|
112
|
+
|
|
113
|
+
const clusterRole = new ClusterRole(mergeDefaults({
|
|
114
|
+
metadata: {
|
|
115
|
+
name: clusterRoleName,
|
|
116
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "rbac" },
|
|
117
|
+
},
|
|
118
|
+
rules: [
|
|
119
|
+
{ apiGroups: [""], resources: ["pods", "nodes", "endpoints"], verbs: ["get", "list", "watch"] },
|
|
120
|
+
{ apiGroups: ["apps"], resources: ["replicasets"], verbs: ["get", "list", "watch"] },
|
|
121
|
+
{ apiGroups: ["batch"], resources: ["jobs"], verbs: ["get", "list", "watch"] },
|
|
122
|
+
{ apiGroups: [""], resources: ["nodes/proxy"], verbs: ["get"] },
|
|
123
|
+
{ apiGroups: [""], resources: ["nodes/stats", "configmaps", "events"], verbs: ["create", "get"] },
|
|
124
|
+
{ apiGroups: [""], resources: ["configmaps"], verbs: ["get", "update", "create"], resourceNames: ["otel-container-insight-clusterleader"] },
|
|
125
|
+
],
|
|
126
|
+
}, defs?.clusterRole));
|
|
127
|
+
|
|
128
|
+
const clusterRoleBinding = new ClusterRoleBinding(mergeDefaults({
|
|
129
|
+
metadata: {
|
|
130
|
+
name: bindingName,
|
|
131
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "rbac" },
|
|
132
|
+
},
|
|
133
|
+
roleRef: {
|
|
134
|
+
apiGroup: "rbac.authorization.k8s.io",
|
|
135
|
+
kind: "ClusterRole",
|
|
136
|
+
name: clusterRoleName,
|
|
137
|
+
},
|
|
138
|
+
subjects: [
|
|
139
|
+
{
|
|
140
|
+
kind: "ServiceAccount",
|
|
141
|
+
name: saName,
|
|
142
|
+
namespace,
|
|
143
|
+
},
|
|
144
|
+
],
|
|
145
|
+
}, defs?.clusterRoleBinding));
|
|
146
|
+
|
|
147
|
+
const configMap = new ConfigMap(mergeDefaults({
|
|
148
|
+
metadata: {
|
|
149
|
+
name: configMapName,
|
|
150
|
+
namespace,
|
|
151
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "config" },
|
|
152
|
+
},
|
|
153
|
+
data: {
|
|
154
|
+
"config.yaml": opts.configYaml,
|
|
155
|
+
},
|
|
156
|
+
}, defs?.configMap));
|
|
157
|
+
|
|
158
|
+
return { daemonSet, serviceAccount, clusterRole, clusterRoleBinding, configMap };
|
|
159
|
+
}
|
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OtelCollector composite: an OpenTelemetry Collector agent on any
|
|
3
|
+
* Kubernetes cluster.
|
|
4
|
+
*
|
|
5
|
+
* A DaemonSet runs the collector on every node, with its config mounted from
|
|
6
|
+
* a ConfigMap, and a Service with `internalTrafficPolicy: Local` sends each
|
|
7
|
+
* pod's OTLP traffic to the collector on its own node. The config is declared
|
|
8
|
+
* with the otel lexicon (`@intentius/chant-lexicon-otel`) and rendered with
|
|
9
|
+
* `collectorYaml`. The container ports, the Service ports and the probes are
|
|
10
|
+
* read back from that config, so they follow whatever config is passed in.
|
|
11
|
+
*
|
|
12
|
+
* `GkeOtelCollector` builds the same DaemonSet, RBAC and ConfigMap for GKE.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
16
|
+
import type { Declarable } from "@intentius/chant/declarable";
|
|
17
|
+
import {
|
|
18
|
+
buildCollectorConfig,
|
|
19
|
+
collectorEndpoints,
|
|
20
|
+
collectorYaml,
|
|
21
|
+
otlpCollector,
|
|
22
|
+
COLLECTOR_CONFIG_PATH,
|
|
23
|
+
COLLECTOR_IMAGE,
|
|
24
|
+
type OTelComponent,
|
|
25
|
+
type Signal,
|
|
26
|
+
} from "@intentius/chant-lexicon-otel";
|
|
27
|
+
import { Service } from "../generated";
|
|
28
|
+
import { collectorAgentResources, type CollectorAgentResources } from "./otel-collector-agent";
|
|
29
|
+
|
|
30
|
+
export interface OtelCollectorProps {
|
|
31
|
+
/** Agent name (default: "otel-collector"). */
|
|
32
|
+
name?: string;
|
|
33
|
+
/** Namespace (default: "observability"). */
|
|
34
|
+
namespace?: string;
|
|
35
|
+
/** Collector image (default: the contrib image at the otel lexicon's pinned collector version). */
|
|
36
|
+
image?: string;
|
|
37
|
+
/**
|
|
38
|
+
* The collector config, as otel lexicon entities (components and
|
|
39
|
+
* pipelines). Replaces the default config, and `exporters` and `signals`
|
|
40
|
+
* are then ignored.
|
|
41
|
+
*/
|
|
42
|
+
config?: Iterable<Declarable>;
|
|
43
|
+
/** Exporters for the default config (default: one `debug` exporter). */
|
|
44
|
+
exporters?: OTelComponent<"exporter", string, any>[];
|
|
45
|
+
/** Signals the default config has pipelines for (default: traces, metrics and logs). */
|
|
46
|
+
signals?: Signal[];
|
|
47
|
+
/** Additional labels. */
|
|
48
|
+
labels?: Record<string, string>;
|
|
49
|
+
/** CPU request (default: "100m"). */
|
|
50
|
+
cpuRequest?: string;
|
|
51
|
+
/** Memory request (default: "256Mi"). */
|
|
52
|
+
memoryRequest?: string;
|
|
53
|
+
/** CPU limit (default: "500m"). */
|
|
54
|
+
cpuLimit?: string;
|
|
55
|
+
/** Memory limit (default: "512Mi"). */
|
|
56
|
+
memoryLimit?: string;
|
|
57
|
+
/** Per-member defaults for fine-grained overrides. */
|
|
58
|
+
defaults?: {
|
|
59
|
+
daemonSet?: Partial<Record<string, unknown>>;
|
|
60
|
+
service?: Partial<Record<string, unknown>>;
|
|
61
|
+
serviceAccount?: Partial<Record<string, unknown>>;
|
|
62
|
+
clusterRole?: Partial<Record<string, unknown>>;
|
|
63
|
+
clusterRoleBinding?: Partial<Record<string, unknown>>;
|
|
64
|
+
configMap?: Partial<Record<string, unknown>>;
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type OtelCollectorResult = CollectorAgentResources & {
|
|
69
|
+
service: InstanceType<typeof Service>;
|
|
70
|
+
};
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Create an OtelCollector composite. Returns a DaemonSet, Service,
|
|
74
|
+
* ServiceAccount, ClusterRole, ClusterRoleBinding and ConfigMap.
|
|
75
|
+
*
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* import { OtelCollector } from "@intentius/chant-lexicon-k8s";
|
|
79
|
+
* import { OtlpExporter } from "@intentius/chant-lexicon-otel";
|
|
80
|
+
*
|
|
81
|
+
* export const collector = OtelCollector({
|
|
82
|
+
* exporters: [new OtlpExporter({ endpoint: "tempo.observability.svc:4317", tls: { insecure: true } })],
|
|
83
|
+
* });
|
|
84
|
+
* ```
|
|
85
|
+
*/
|
|
86
|
+
export const OtelCollector = Composite((props: OtelCollectorProps) => {
|
|
87
|
+
const {
|
|
88
|
+
name = "otel-collector",
|
|
89
|
+
namespace = "observability",
|
|
90
|
+
image = COLLECTOR_IMAGE,
|
|
91
|
+
labels: extraLabels = {},
|
|
92
|
+
cpuRequest = "100m",
|
|
93
|
+
memoryRequest = "256Mi",
|
|
94
|
+
cpuLimit = "500m",
|
|
95
|
+
memoryLimit = "512Mi",
|
|
96
|
+
defaults: defs,
|
|
97
|
+
} = props;
|
|
98
|
+
|
|
99
|
+
const commonLabels: Record<string, string> = {
|
|
100
|
+
"app.kubernetes.io/name": name,
|
|
101
|
+
"app.kubernetes.io/managed-by": "chant",
|
|
102
|
+
...extraLabels,
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const entities = props.config ? [...props.config] : otlpCollector({ exporters: props.exporters, signals: props.signals });
|
|
106
|
+
const { ports, healthCheck } = collectorEndpoints(buildCollectorConfig(entities).config);
|
|
107
|
+
const configDir = COLLECTOR_CONFIG_PATH.slice(0, COLLECTOR_CONFIG_PATH.lastIndexOf("/"));
|
|
108
|
+
|
|
109
|
+
// The probe names the port. A health_check on a receiver's port reuses that
|
|
110
|
+
// port's name, since a container port is declared once.
|
|
111
|
+
const healthPortName = healthCheck ? (ports.find((p) => p.port === healthCheck.port)?.name ?? "health") : undefined;
|
|
112
|
+
const probe = healthCheck ? { httpGet: { path: healthCheck.path, port: healthPortName } } : undefined;
|
|
113
|
+
const containerPorts = [
|
|
114
|
+
...ports.map((p) => ({ containerPort: p.port, name: p.name })),
|
|
115
|
+
...(healthCheck && !ports.some((p) => p.port === healthCheck.port)
|
|
116
|
+
? [{ containerPort: healthCheck.port, name: "health" }]
|
|
117
|
+
: []),
|
|
118
|
+
];
|
|
119
|
+
|
|
120
|
+
const resources = collectorAgentResources({
|
|
121
|
+
name,
|
|
122
|
+
namespace,
|
|
123
|
+
image,
|
|
124
|
+
commonLabels,
|
|
125
|
+
extraLabels,
|
|
126
|
+
configYaml: collectorYaml(entities),
|
|
127
|
+
configDir,
|
|
128
|
+
ports: containerPorts,
|
|
129
|
+
cpuRequest,
|
|
130
|
+
memoryRequest,
|
|
131
|
+
cpuLimit,
|
|
132
|
+
memoryLimit,
|
|
133
|
+
containerExtra: {
|
|
134
|
+
securityContext: {
|
|
135
|
+
runAsNonRoot: true,
|
|
136
|
+
runAsUser: 10001,
|
|
137
|
+
readOnlyRootFilesystem: true,
|
|
138
|
+
allowPrivilegeEscalation: false,
|
|
139
|
+
capabilities: { drop: ["ALL"] },
|
|
140
|
+
},
|
|
141
|
+
...(probe ? { livenessProbe: probe, readinessProbe: probe } : {}),
|
|
142
|
+
},
|
|
143
|
+
defaults: defs,
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
const service = new Service(mergeDefaults({
|
|
147
|
+
metadata: {
|
|
148
|
+
name,
|
|
149
|
+
namespace,
|
|
150
|
+
labels: { ...commonLabels, "app.kubernetes.io/component": "agent" },
|
|
151
|
+
},
|
|
152
|
+
spec: {
|
|
153
|
+
selector: { "app.kubernetes.io/name": name },
|
|
154
|
+
internalTrafficPolicy: "Local",
|
|
155
|
+
ports: ports.map((p) => ({ name: p.name, port: p.port, targetPort: p.name, protocol: "TCP" })),
|
|
156
|
+
},
|
|
157
|
+
}, defs?.service));
|
|
158
|
+
|
|
159
|
+
return { ...resources, service };
|
|
160
|
+
}, "OtelCollector");
|
package/src/index.ts
CHANGED
|
@@ -69,7 +69,7 @@ export * from "./generated/index";
|
|
|
69
69
|
export {
|
|
70
70
|
WebApp, StatefulApp, CronWorkload, AutoscaledService, WorkerPool, NamespaceEnv, NodeAgent,
|
|
71
71
|
BatchJob, SecureIngress, ConfiguredApp, SidecarApp, MonitoredService, NetworkIsolatedApp,
|
|
72
|
-
IrsaServiceAccount, AlbIngress, EbsStorageClass, EfsStorageClass, FluentBitAgent, ExternalDnsAgent, AdotCollector,
|
|
72
|
+
IrsaServiceAccount, AlbIngress, EbsStorageClass, EfsStorageClass, FluentBitAgent, ExternalDnsAgent, AdotCollector, OtelCollector,
|
|
73
73
|
MetricsServer, WorkloadIdentityServiceAccount, GcePdStorageClass, FilestoreStorageClass, GkeGateway, ConfigConnectorContext,
|
|
74
74
|
GceIngress, CockroachDbCluster, CockroachDbRegionStack,
|
|
75
75
|
RayCluster, RayJob, RayService,
|
|
@@ -92,6 +92,7 @@ export type {
|
|
|
92
92
|
EbsStorageClassProps, EbsStorageClassResult, EfsStorageClassProps, EfsStorageClassResult,
|
|
93
93
|
FluentBitAgentProps, FluentBitAgentResult, ExternalDnsAgentProps, ExternalDnsAgentResult,
|
|
94
94
|
AdotCollectorProps, AdotCollectorResult,
|
|
95
|
+
OtelCollectorProps, OtelCollectorResult,
|
|
95
96
|
MetricsServerProps, MetricsServerResult,
|
|
96
97
|
WorkloadIdentityServiceAccountProps, WorkloadIdentityServiceAccountResult,
|
|
97
98
|
GcePdStorageClassProps, GcePdStorageClassResult,
|