Skip to content

Kubernetes

Deploy the KloudMate Agent to Kubernetes with a DaemonSet and Deployment.

What the Kubernetes Agent Monitors

Once installed, the Kubernetes Agent collects:

  • Cluster metrics: CPU, memory, disk, network usage
  • Node metrics: Resource usage, health, availability
  • Namespace metrics: Workloads, events per namespace
  • Pod metrics: CPU, memory, restarts, and lifecycle events
  • Workload metrics: Deployment and replica status, resource utilization
  • Container logs: stdout/stderr from pods
  • Cluster events: Pod failures, scaling events, and other events
  • Optional APM metrics: Instrumented applications (Python, Node.js, Java, .NET, Go)

View all Kubernetes data in these KloudMate sections:

1. Kubernetes Monitoring

  • Explore metrics and events for your cluster, nodes, namespaces, pods, and workloads
  • Track availability, resource usage, pod restarts, and workload health

Kubernetes Monitoring

2. Dashboards

Creating a Dashboard

3. Log Explorer

  • Search and filter pod logs and cluster events
  • Correlate logs with metrics to troubleshoot container or application issues

Log Explorer

Use the KloudMate Kubernetes Agent to monitor your Kubernetes infrastructure and optionally your applications (APM) without any code changes.

Pre-requisites

  • Kubernetes version 1.24 or above
  • Helm version 3.0 or above
  • Cert Manager version v1.18.2 or above
  • Network access and permissions from Before you start if your outbound traffic is restricted

Skip this step if you already have Cert Manager installed.

helm install \
  cert-manager oci://quay.io/jetstack/charts/cert-manager \
  --namespace cert-manager \
  --create-namespace \
  --set crds.enabled=true

Provide a name for your Kubernetes cluster. This name identifies the cluster inside KloudMate.

Configure how KloudMate should collect data from this cluster:

  • Collect container logs: Turn this on to collect container logs from the cluster.
  • Enable auto instrumentation for APM: Turn this on to install the APM components, including the OpenTelemetry Operator. After install, you choose per workload whether to trace it, and how — nothing is traced until you do. Supported SDK runtimes are Python, Node.js, Java, and .NET; Go and other runtimes are traced with eBPF.
  • Monitored namespaces: Enter a comma‑separated list of namespaces to discover workloads in for APM (for example, redis, kafka, prod-app).

The UI generates a Helm command from your inputs. Run it in your terminal to install the KloudMate Agent in your Kubernetes cluster.

helm repo add kloudmate https://charts.kloudmate.com
helm repo update
helm install kloudmate-release kloudmate/km-kube-agent \
  --namespace km-agent --create-namespace \
  --set API_KEY="" \
  --set COLLECTOR_ENDPOINT="https://otel.kloudmate.com:4318" \
  --set clusterName="test" \
  --set monitoredNamespaces="default, prod, dev" \
  --set featuresEnabled.logs="true" \
  --set featuresEnabled.apm="false"

If your Kubernetes cluster has nodes with taints, the agent pods need matching tolerations to be scheduled. By default, the agent includes no tolerations. You can add them during installation with Helm parameters.

Example Helm installation command with tolerations:

helm install kloudmate-release kloudmate/km-kube-agent --namespace km-agent --create-namespace \
--set API_KEY="" --set COLLECTOR_ENDPOINT="https://otel.kloudmate.com:4318" \
--set clusterName="" \
--set "monitoredNamespaces={MONITORED_NS}" \
--set tolerations[0].key="env" --set tolerations[0].operator="Equal" --set tolerations[0].value="uat" --set tolerations[0].effect="NoSchedule" \
--set tolerations[1].key="env" --set tolerations[1].operator="Equal" --set tolerations[1].value="sb-uat-node" --set tolerations[1].effect="NoSchedule" \

This example defines two tolerations to match the taints on the cluster nodes, so the agent pods can schedule on all the nodes they need.

There are two ways to enable Application Performance Monitoring (APM) in your cluster:

  • After installing the agent, open the APM configuration tab in the dashboard.
  • The agent lists the workloads it discovered, grouped by namespace, with each workload’s detected language. Use the namespace filter or the search box to find one in a large cluster.
  • For each workload, choose Off, eBPF, or SDK, then apply. eBPF starts tracing on the next check-in with no restart; SDK rolls that workload’s pods. Workloads with no SDK injector — Go, Ruby, or an unrecognized runtime — offer Off or eBPF only.

image

  • After you turn a workload on, wait a few minutes for its traces to start, then verify them on the dashboard.

2. Enable SDK tracing via the Patch Method

Section titled “2. Enable SDK tracing via the Patch Method”

Sometimes the agent doesn’t detect certain applications. When that happens, use deployment annotations to turn on SDK tracing for them. (This is the SDK path only; eBPF tracing is driven by the DaemonSet and has no annotation.)

Steps:

1. Identify each application that requires APM.

2. You can enable APM with either of these methods:

  • Option 1 – Patch command
kubectl patch deployment <name> -n <ns> -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-java":"km-agent/km-agent-instrumentation-crd"}}}}}'
  • Option 2 – Add annotation
 annotations
    instrumentation.opentelemetry.io/inject-java: km-agent/km-agent-instrumentation-crd   
  • Option 1 – Patch command
kubectl patch deployment <name> -n <ns> -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-python":"km-agent/km-agent-instrumentation-crd"}}}}}'
  • Option 2 – Add annotation
annotations
      instrumentation.opentelemetry.io/inject-python: km-agent/km-agent-instrumentation-crd 
  • Option 1 – Patch command
kubectl patch deployment <name> -n <ns> -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-nodejs":"km-agent/km-agent-instrumentation-crd"}}}}}'
  • Option 2 – Add annotation
annotations
    instrumentation.opentelemetry.io/inject-nodejs: km-agent/km-agent-instrumentation-crd
  • Option 1 – Patch command
kubectl patch deployment <name> -n <ns> -p '{"spec":{"template":{"metadata":{"annotations":{"instrumentation.opentelemetry.io/inject-dotnet":"km-agent/km-agent-instrumentation-crd"}}}}}'
  • Option 2 – Add annotation
annotations
    instrumentation.opentelemetry.io/inject-dotnet: km-agent/km-agent-instrumentation-crd

3. Restart the deployments after adding the annotations.

On Kubernetes, one agent represents one cluster. A fleet-manager pod applies the configuration, and the DaemonSet and Deployment collector pods do the collecting. The Helm chart installs the cluster role-based access control (RBAC) the agent needs. See Kubernetes platform notes.

  • Open Kubernetes Monitoring to view metrics and events for your cluster, nodes, namespaces, pods, and workloads
  • Use Dashboards to create visualizations or view pre-built dashboards
  • Use Log Explorer to investigate logs and correlate them with metrics
  • Configure alerts for any of these components based on thresholds