1
Gather your prerequisites
You’ll need:
- A Kubernetes cluster (v1.20+ recommended) with
kubectlconfigured against it. - Helm v3+.
- The OTLP endpoint of your ClickStack gateway collector, reachable from inside the cluster, for example
http://clickstack-otel-collector.observability.svc.cluster.local:4318. The collector should be deployed somewhere your DaemonSets and Deployment can reach it, typically in the same cluster or via a service of typeLoadBalancer. - The
OTLP_AUTH_TOKENvalue you set when deploying the gateway collector. If you didn’t secure the collector, you can skip the secret step below and drop theauthorizationheader from the manifests.
Where the gateway runsFor a cluster-local deployment, run the gateway collector as a Kubernetes
Deployment or StatefulSet inside the same cluster and address it through its in-cluster service DNS. For a gateway running outside the cluster, use its externally reachable URL.2
Create the auth secret and ConfigMap
Pick the namespace you want the collectors to live in, then create a secret holding the Both collectors below read these values via
OTLP_AUTH_TOKEN and a ConfigMap pointing at your gateway:extraEnvs, so the same secret and ConfigMap are reused across them.3
Add the OpenTelemetry Helm repo
4
Deploy the cluster collector
This is a single-replica Deployment that collects Kubernetes events and cluster-wide metrics (node counts, pod phases, deployment status, and so on). Running more than one replica would produce duplicates.Save the following as
Install it:
k8s_deployment.yaml:k8s_deployment.yaml
k8s_deployment.yaml
5
Deploy the node collector
This is a DaemonSet that runs on every node to collect container logs, host metrics, and kubelet metrics (per-pod and per-container CPU and memory utilisation against requests and limits).Save the following as
Install it:Confirm both releases are healthy:You should see one Deployment pod and one DaemonSet pod per node, all in
k8s_daemonset.yaml:k8s_daemonset.yaml
k8s_daemonset.yaml
Running state.6
Forward Kubernetes attributes to your apps (recommended)
To correlate your application logs, metrics, and traces with Kubernetes metadata (pod name, namespace, node, deployment), forward the metadata into your application via
OTEL_RESOURCE_ATTRIBUTES. The DaemonSet’s k8sattributes processor will then enrich incoming telemetry with the matching pod and node attributes.7
Confirm in the ClickStack UI
Open your service in the ClickHouse Cloud console and select ClickStack from the left menu.In the Search view, switch the source to
Logs and set the time range to Last 15 minutes. Container logs from across the cluster should appear within a few seconds, enriched with attributes like k8s.namespace.name, k8s.pod.name, and k8s.node.name.To see infrastructure metrics and events in context, open the built-in Kubernetes dashboard by navigating to Dashboards -> Kubernetes. The Pods, Nodes, and Namespaces tabs should all be populated.If nothing shows up:- Verify the DaemonSet and Deployment pods are
Runningand tail their logs withkubectl logs -n ${NAMESPACE} <pod>. - Confirm
YOUR_OTEL_COLLECTOR_ENDPOINTis reachable from inside the cluster (kubectl execinto one of the collector pods andcurlit). - Check that the
OTLP_AUTH_TOKENin the secret matches the value set on the gateway collector.
8
Further reading
- Kubernetes integration reference for the full set of receivers, processors, and tuning options.
- Forwarding resource tags to pods for more detail on application-side enrichment.
- Securing the collector with TLS on the OTLP endpoint and least-privilege ingestion users.
- Estimating resources for gateway and agent deployments at your expected throughput.
- Going to production for recommendations when going to production.