Kubernetes

Overview

Run the Granulate Agent in your Kubernetes cluster as a DaemonSet in order to start learning your application resource usage patterns and optimize your application performance. You can deploy it directly with a DaemonSet object YAML definition.

Installation

Take advantage of DaemonSets to deploy the Granulate Agent on all your nodes (or on specific nodes by using nodeSelectors).

1. Create the Granulate gAgent manifest: Install the Granulate Agent on your Kubernetes cluster using the gAgent manifest template. In order to deploy Granulate gAgent using the templates you would need the following parameters:

  • Docker Hub Secret - Granulte docker hub secret to pull the relevant gAgent docker image deployed

  • Client ID - A unique customer license key that is required for the agent's authentication.

  • Service ID - A customer-defined service identifier used to correlate all the agents that are installed in the same customer service.

Note: Those manifests are set for thegranulatenamespace by default. If you are in a custom namespace, update themetadata.namespaceparameter before applying them.

2. Deploy the gAgent DaemonSet with the command:

kubectl apply -f daemonset_gagent.yaml

3. Verify Deployment: to verify the Granulate gAgent is running in your environment as a DaemonSet execute the following command:

kubectl get daemonset

if the Agent is deployed, you will see output similar to the text below, where DESIRED and CURRENT are equal to the number of nodes running in your cluster.

NAME DESIRED CURRENT READY UP-TO-DATE AVAILABLE NODE SELECTOR AGE
granulate-agent 2 2 2 2 2 <none> 10s

Additional Configuration

Environment Variables

Find below the list of environment variables available for the Granulate gAgent.

Env Variable

Description

CLIENT_ID

You Granulate API authentication key (required)

SERVICE_ID

A tag to aggregate the agents installed on the same service

PROXY_SERVER

Optional setting to configure communication using HTTP/SOCKS5 proxy

ADDRESS

Destination site for your K8s collected metrics. Defaults to granulate.io

CONTAINER_UNITS

Optional setting to override the URL for metric submission