KloudMate Agents
Kubernetes Agent
9 min
this document will guide you to instrument kubernetes using the kloudmate agent via daemonset & deployment the commands below are for reference only log in to kloudmate and copy your account specific command to install the agent pre requisites kubernetes version 1 24 or above helm version 3 0 or above cert manager version v1 18 2 or above install agent step 1 install cert manager if it is not already installed helm install \\ cert manager oci //quay io/jetstack/charts/cert manager \\ \ namespace cert manager \\ \ create namespace \\ \ set crds enabled=true step 2 enter the name of your kubernetes cluster step 3 in the 'enabled namespaces' field, specify the namespaces for which you want to collect kubernetes event logs if left empty, logs from all available namespaces will be included step 4 (optional) enable auto instrumentation to instrument your application for monitoring step 5 run the command to install the km agent in your kubernetes cluster helm repo add kloudmate https //kloudmate github io/km agent helm repo update helm install kloudmate release kloudmate/km kube agent namespace km agent create namespace \\ \ set api key="\<your api key>" \n set collector endpoint="https //otel kloudmate com 4318" \\ \ set clustername="\<your cluster name>" \\ \ set "monitorednamespaces={monitored ns}" installing the agent on tainted nodes if your kubernetes cluster has nodes with taints, the agent pods must be assigned matching tolerations to be scheduled successfully by default, the agent does not include any tolerations, but you can configure them during installation by using helm parameters example helm installation command with tolerations helm install kloudmate release kloudmate/km kube agent namespace km agent create namespace \\ \ set api key="\<your api key>" set collector endpoint="https //otel kloudmate com 4318" \\ \ set clustername="\<your cluster name>" \\ \ 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" \\ in this example, two separate tolerations are defined to match the taints configured on the cluster nodes, enabling the agent pods to be scheduled on all required nodes you can add any number of tolerations by incrementing the index ( tolerations\[0] , tolerations\[1] , etc ) ensure that the key, operator, value, and effect match the taints applied to your nodes if your cluster does not have taints, these parameters can be omitted the agent pods will then be scheduled on untainted nodes by default apm setup instructions there are two ways to enable application performance monitoring (apm) in your cluster 1\ enable apm via dashboard after installing the agent, open the apm configuration tab in the dashboard use the toggle button to enable or disable apm once enabled, the agent will automatically detect all running microservices and identify their respective programming languages after turning on apm, wait a few minutes to begin receiving metrics, then verify them on the dashboard 2\ enable apm via the patch method in some cases, the agent may not automatically detect certain applications in such scenarios, use deployment annotations to enable apm for your applications steps 1\ identify each application that requires apm 2\ edit or patch the corresponding deployments to include the required annotation for its language java annotations instrumentation opentelemetry io/inject java km agent/km agent instrumentation crd python annotations instrumentation opentelemetry io/inject python km agent/km agent instrumentation crd node js annotations instrumentation opentelemetry io/inject nodejs km agent/km agent instrumentation crd net annotations instrumentation opentelemetry io/inject dotnet km agent/km agent instrumentation crd 3\ restart the deployments after adding the annotations