Skip to content

Commit

Permalink
init: k8s-tracing
Browse files Browse the repository at this point in the history
Signed-off-by: Benedikt Bongartz <bongartz@klimlive.de>
  • Loading branch information
frzifus committed Mar 15, 2024
1 parent 94c4aae commit f5bb1c2
Show file tree
Hide file tree
Showing 5 changed files with 81 additions and 1 deletion.
1 change: 1 addition & 0 deletions 08-k8s-tracing.md
@@ -0,0 +1 @@
# Tracing
3 changes: 2 additions & 1 deletion README.md
Expand Up @@ -23,8 +23,9 @@ Each tutorial step is located in a separate file:
1. [Welcome & Setup](01-welcome-setup.md) (Pavol, 5 min)
1. [OpenTelemetry distributed tracing introduction](02-tracing-introduction.md) (Matej, 10 min)
1. [Auto-instrumentation](03-auto-instrumentation.md) (Pavol, 25 min)
1. [Manual-instrumentation](04-manual-instrumentation.md) (Bene & Matej, 10 min)
1. [Manual-instrumentation](04-manual-instrumentation.md) (Bene, 10 min)
1. [Sampling](05-sampling.md) (Bene & Anu, 15 min)
1. [Metrics from Traces](06-RED-metrics.md) (Anthony, 10 min)
1. [OpenTelemetry Transformation Language and Spans](07-ottl.md) (Matej, 10 min)
1. Wrap up & Questions
1. [K8S-Tracing](08-k8s-tracing.md) (Bene, optional)
5 changes: 5 additions & 0 deletions app/api-server/tracing-config.yaml
@@ -0,0 +1,5 @@
apiVersion: apiserver.config.k8s.io/v1alpha1
kind: TracingConfiguration
endpoint: 127.0.0.1:4317
samplingRatePerMillion: 1000000

28 changes: 28 additions & 0 deletions app/otel-daemonset.yaml
@@ -0,0 +1,28 @@
apiVersion: opentelemetry.io/v1alpha1
kind: OpenTelemetryCollector
metadata:
name: system-tracing
namespace: kube-system
spec:
mode: daemonset
hostNetwork: true
config: |
receivers:
otlp:
protocols:
grpc:
endpoint: 0.0.0.0:4317
processors:
exporters:
otlp:
endpoint: "otel-collector.observability-backend.svc.cluster.local:4317"
tls:
insecure: true
service:
pipelines:
traces:
receivers: [otlp]
processors: []
exporters: [otlp]
45 changes: 45 additions & 0 deletions kind-1.29.yaml
@@ -0,0 +1,45 @@
---
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
APIServerTracing: true
nodes:
- role: control-plane
image: kindest/node:v1.29.1@sha256:a0cc28af37cf39b019e2b448c54d1a3f789de32536cb5a5db61a49623e527144
extraMounts:
- hostPath: ./app/api-server/
containerPath: /api-server
readOnly: true
selinuxRelabel: true
kubeadmConfigPatches:
- |
kind: KubeletConfiguration
featureGates:
KubeletTracing: true
tracing:
samplingRatePerMillion: 1000000
endpoint: "127.0.0.1:4317"
- |
kind: ClusterConfiguration
etcd:
local:
# NOTE: https://github.com/etcd-io/etcd/pull/16951
imageRepository: "quay.io/coreos"
imageTag: "v3.5.11"
extraArgs:
experimental-enable-distributed-tracing: "true"
# NOTE: Default: localhost:4317, we avoid IPv6
experimental-distributed-tracing-address: 127.0.0.1:4317
experimental-distributed-tracing-service-name: "etcd"
experimental-distributed-tracing-instance-id: "caf201fd-8d5b-467b-a70f-09ad3beb5a21"
# NOTE: Only availabile in etcd 3.5.11 or higher
experimental-distributed-tracing-sampling-rate: "1000000"
apiServer:
extraArgs:
tracing-config-file: "/api-server/tracing-config.yaml"
extraVolumes:
- name: tracingConfig
hostPath: /api-server/tracing-config.yaml
mountPath: /api-server/tracing-config.yaml
readOnly: true
pathType: "File"

0 comments on commit f5bb1c2

Please sign in to comment.