Monitoring Kubernetes
This guide walks you through collecting logs, infrastructure metrics, and Kubernetes events from a cluster into Managed ClickStack, then viewing them in the built-in Kubernetes dashboard.
The pattern is the standard OpenTelemetry one: two collectors deployed via the OpenTelemetry Helm chart, each forwarding to your ClickStack gateway collector via OTLP. A DaemonSet runs on every node to collect container logs and kubelet metrics. A Deployment with a single replica collects Kubernetes events and cluster-wide metrics. For background on the gateway role, see Collector roles.
This guide assumes you've completed Setting up your OpenTelemetry Collector and have a ClickStack gateway collector running.
For a Kubernetes-resident workload, the gateway collector itself should be deployed inside the same cluster using the upstream OpenTelemetry Helm chart with the ClickStack collector image. Follow the Helm path in Deploying the collector to install it. Ensure you have recorded this OTLP endpoint.
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.
For 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.
Create the auth secret and ConfigMap
Pick the namespace you want the collectors to live in, then create a secret holding the OTLP_AUTH_TOKEN and a ConfigMap pointing at your gateway:
Both collectors below read these values via extraEnvs, so the same secret and ConfigMap are reused across them.
Add the OpenTelemetry Helm repo
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 k8s_deployment.yaml:k8s_deployment.yaml
Install it:
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 k8s_daemonset.yaml:k8s_daemonset.yaml
Install it:
Confirm both releases are healthy:
You should see one Deployment pod and one DaemonSet pod per node, all in Running state.
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.
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.
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.