Skip to content

Commit 9f0136e

Browse files
authored
Document k8s cache (#2177)
* Document k8s cache * bump chart + generate examples * disclaimer on obi kubernetes api access
1 parent 9e2cc26 commit 9f0136e

14 files changed

Lines changed: 57 additions & 18 deletions

File tree

charts/opentelemetry-ebpf-instrumentation/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
apiVersion: v2
33
name: opentelemetry-ebpf-instrumentation
4-
version: 0.8.0
4+
version: 0.8.1
55
description: OpenTelemetry eBPF instrumentation Helm chart for Kubernetes
66
type: application
77
home: https://opentelemetry.io/

charts/opentelemetry-ebpf-instrumentation/README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,45 @@ podAnnotations:
9595
This requires bundling the `ConfigMap` definition in the Helm release for
9696
checksum evaluation.
9797

98+
### Centralizing Kubernetes metadata with `k8s-cache`
99+
100+
By default each OBI Pod opens its own `list`/`watch` connections to the
101+
Kubernetes API server to read Pod, Node, and Service metadata for the entire
102+
cluster (needed to enrich destination/peer attributes on traces, flows and
103+
metrics). On large clusters, or when many OBI replicas run side by side
104+
(`DaemonSet`, large `Deployment`, sidecars), this fan-out can put significant
105+
load on the API server.
106+
107+
`k8s-cache` is an optional companion `Deployment` shipped with OBI. It runs
108+
the Kubernetes informers once on behalf of every OBI Pod and streams the
109+
metadata back over gRPC, so OBI Pods no longer hit the API server for
110+
informer traffic.
111+
112+
> **Note:** Even when `k8s-cache` is enabled, OBI Pods still need their own
113+
> `ServiceAccount` and may perform limited direct Kubernetes API lookups for
114+
> node and cluster metadata. The cache eliminates the per-Pod informer
115+
> watch traffic, not all API access.
116+
117+
The cache is disabled by default. To enable it, set `k8sCache.replicas` to a
118+
non-zero value:
119+
120+
```yaml
121+
k8sCache:
122+
replicas: 1
123+
```
124+
125+
A single replica is usually enough. For high availability or very large
126+
clusters, increase the replica count — OBI Pods load-balance across them
127+
through the cache `Service` and reconnect to a healthy replica on failure.
128+
129+
When `k8sCache.replicas > 0` the chart deploys the cache `Deployment` and
130+
`Service`, and automatically points the OBI `DaemonSet` at it by setting
131+
`OTEL_EBPF_KUBE_META_CACHE_ADDRESS` to `<k8sCache.service.name>:<k8sCache.service.port>`.
132+
See the `k8sCache` block in [values.yaml](./values.yaml) for image, resource,
133+
and metrics settings, and the
134+
[OBI Kubernetes setup guide](https://opentelemetry.io/docs/zero-code/obi/setup/kubernetes/#centralizing-kubernetes-metadata-with-k8s-cache)
135+
for background.
136+
98137
### Pod Annotations with Template Support
99138

100139
The `podAnnotations` values support Helm templating, enabling dynamic values:

charts/opentelemetry-ebpf-instrumentation/examples/default/rendered/clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: ClusterRole
55
metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
labels:
8-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
8+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
99
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1010
app.kubernetes.io/instance: example
1111
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/default/rendered/clusterrolebinding.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: ClusterRoleBinding
55
metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
labels:
8-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
8+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
99
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1010
app.kubernetes.io/instance: example
1111
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/default/rendered/configmap.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
namespace: default
88
labels:
9-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
9+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
1010
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1111
app.kubernetes.io/instance: example
1212
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/default/rendered/daemonset.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
namespace: default
88
labels:
9-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
9+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
1010
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1111
app.kubernetes.io/instance: example
1212
app.kubernetes.io/version: "v0.8.0"
@@ -23,10 +23,10 @@ spec:
2323
template:
2424
metadata:
2525
annotations:
26-
checksum/config: 2f8c668f767b5920a9572351969fb1d67d2dd03d1b8e048e959b66e234ffabf6
26+
checksum/config: bffeb93bcea4aec5857780862be8b5b7784d83b01e62540bc7a25bd8dc128cc0
2727

2828
labels:
29-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
29+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
3030
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
3131
app.kubernetes.io/instance: example
3232
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/default/rendered/serviceaccount.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
namespace: default
88
labels:
9-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
9+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
1010
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1111
app.kubernetes.io/instance: example
1212
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/with-k8s-cache/rendered/cache-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: opentelemetry-ebpf-instrumentation-k8s-cache
77
namespace: default
88
labels:
9-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
9+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
1010
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation-k8s-cache
1111
app.kubernetes.io/instance: example
1212
app.kubernetes.io/version: "v0.8.0"
@@ -21,7 +21,7 @@ spec:
2121
template:
2222
metadata:
2323
labels:
24-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
24+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
2525
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation-k8s-cache
2626
app.kubernetes.io/instance: example
2727
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/with-k8s-cache/rendered/cache-service.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ metadata:
66
name: opentelemetry-ebpf-instrumentation-k8s-cache
77
namespace: default
88
labels:
9-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
9+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
1010
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation-k8s-cache
1111
app.kubernetes.io/instance: example
1212
app.kubernetes.io/version: "v0.8.0"

charts/opentelemetry-ebpf-instrumentation/examples/with-k8s-cache/rendered/clusterrole.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ kind: ClusterRole
55
metadata:
66
name: example-opentelemetry-ebpf-instrumentation
77
labels:
8-
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.0
8+
helm.sh/chart: opentelemetry-ebpf-instrumentation-0.8.1
99
app.kubernetes.io/name: opentelemetry-ebpf-instrumentation
1010
app.kubernetes.io/instance: example
1111
app.kubernetes.io/version: "v0.8.0"

0 commit comments

Comments
 (0)