Skip to content

Commit f5bb1c2

Browse files
committed
init: k8s-tracing
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
1 parent 94c4aae commit f5bb1c2

File tree

5 files changed

+81
-1
lines changed

5 files changed

+81
-1
lines changed

08-k8s-tracing.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Tracing

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ Each tutorial step is located in a separate file:
2323
1. [Welcome & Setup](01-welcome-setup.md) (Pavol, 5 min)
2424
1. [OpenTelemetry distributed tracing introduction](02-tracing-introduction.md) (Matej, 10 min)
2525
1. [Auto-instrumentation](03-auto-instrumentation.md) (Pavol, 25 min)
26-
1. [Manual-instrumentation](04-manual-instrumentation.md) (Bene & Matej, 10 min)
26+
1. [Manual-instrumentation](04-manual-instrumentation.md) (Bene, 10 min)
2727
1. [Sampling](05-sampling.md) (Bene & Anu, 15 min)
2828
1. [Metrics from Traces](06-RED-metrics.md) (Anthony, 10 min)
2929
1. [OpenTelemetry Transformation Language and Spans](07-ottl.md) (Matej, 10 min)
3030
1. Wrap up & Questions
31+
1. [K8S-Tracing](08-k8s-tracing.md) (Bene, optional)

app/api-server/tracing-config.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: apiserver.config.k8s.io/v1alpha1
2+
kind: TracingConfiguration
3+
endpoint: 127.0.0.1:4317
4+
samplingRatePerMillion: 1000000
5+

app/otel-daemonset.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
apiVersion: opentelemetry.io/v1alpha1
2+
kind: OpenTelemetryCollector
3+
metadata:
4+
name: system-tracing
5+
namespace: kube-system
6+
spec:
7+
mode: daemonset
8+
hostNetwork: true
9+
config: |
10+
receivers:
11+
otlp:
12+
protocols:
13+
grpc:
14+
endpoint: 0.0.0.0:4317
15+
processors:
16+
17+
exporters:
18+
otlp:
19+
endpoint: "otel-collector.observability-backend.svc.cluster.local:4317"
20+
tls:
21+
insecure: true
22+
service:
23+
pipelines:
24+
traces:
25+
receivers: [otlp]
26+
processors: []
27+
exporters: [otlp]
28+

kind-1.29.yaml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
---
2+
kind: Cluster
3+
apiVersion: kind.x-k8s.io/v1alpha4
4+
featureGates:
5+
APIServerTracing: true
6+
nodes:
7+
- role: control-plane
8+
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
9+
extraMounts:
10+
- hostPath: ./app/api-server/
11+
containerPath: /api-server
12+
readOnly: true
13+
selinuxRelabel: true
14+
kubeadmConfigPatches:
15+
- |
16+
kind: KubeletConfiguration
17+
featureGates:
18+
KubeletTracing: true
19+
tracing:
20+
samplingRatePerMillion: 1000000
21+
endpoint: "127.0.0.1:4317"
22+
- |
23+
kind: ClusterConfiguration
24+
etcd:
25+
local:
26+
# NOTE: https://github.com/etcd-io/etcd/pull/16951
27+
imageRepository: "quay.io/coreos"
28+
imageTag: "v3.5.11"
29+
extraArgs:
30+
experimental-enable-distributed-tracing: "true"
31+
# NOTE: Default: localhost:4317, we avoid IPv6
32+
experimental-distributed-tracing-address: 127.0.0.1:4317
33+
experimental-distributed-tracing-service-name: "etcd"
34+
experimental-distributed-tracing-instance-id: "caf201fd-8d5b-467b-a70f-09ad3beb5a21"
35+
# NOTE: Only availabile in etcd 3.5.11 or higher
36+
experimental-distributed-tracing-sampling-rate: "1000000"
37+
apiServer:
38+
extraArgs:
39+
tracing-config-file: "/api-server/tracing-config.yaml"
40+
extraVolumes:
41+
- name: tracingConfig
42+
hostPath: /api-server/tracing-config.yaml
43+
mountPath: /api-server/tracing-config.yaml
44+
readOnly: true
45+
pathType: "File"

0 commit comments

Comments
 (0)