grafana-agent

by DandyDeveloper

Helm chartv0.19.2App v0.20.0Verified publisher

Deploy an instance of the Grafana agent on all appropriate nodes for scraping Prometheus metrics.

About this chart

Grafana Agent

Grafana Agent is an alternative to Prometheus specifically crafted for remote writes. Grafana Agent removes the fluff from Prometheus to provide a more compact experience with Prometheus.

TL;DR

helm repo add dandydev https://dandydeveloper.github.io/charts
helm install dandydev/grafana-agent

By default, this chart will install a DaemonSet across all nodes. Those agents will scrape the metrics from the local node and its resources.

Introduction

This chart bootstraps a Grafana Agent.

Prerequisites

  • Kubernetes 1.15+
  • PV provisioner support in the underlying infrastructure (if scrapingService.enabled)

Installing the Chart

To install the chart

helm repo add dandydev https://dandydeveloper.github.io/charts
helm install dandydev/grafana-agent

Uninstalling the Chart

To uninstall/delete the deployment:

helm delete <Release Name>

The command removes all the Kubernetes components associated with the chart and deletes the release.

Configuration

The following table lists the configurable parameters of the Grafana Agent chart and their default values.

ParameterDescriptionTypeDefault
affinityAffinity rulesobject{}
config.existingConfigMapAn existing ConfigMap entity that already exists, or is deployed by a parent chart. Populate this to provide an existing config for Grafana Agent. This disables the charts configMap.string""
config.logLevelServer log_levelstring"info"
config.loki.configsLoki config contentstringsee values.yaml
config.loki.enabledEnable Loki configbooltrue
config.prometheus.configsScrape configs / General configs for the Prometheus scrapingstringsee values.yaml
config.prometheus.enabledEnable Prometheus configbooltrue
config.prometheus.externalLabelsExternal labelsobject{}
config.prometheus.remoteWrite.authRemote write username/passwordstringnil
config.prometheus.remoteWrite.urlURL for the upstream federated Prometheus / Cortex instancestring"http://cortex.default.svc.cluster.local"
config.prometheus.scrapeIntervalGlobal scrape intervalstring"15s"
config.prometheus.walDirDirectory mount point for Grafana Agent WALstring"/var/lib/agent/data"
config.tempo.configsTempo config contentstringsee values.yaml
config.tempo.enabledEnable Tempo configbooltrue
consulConfigure consul subchart resp. dependency chart Only deployed when scrapingServiceMode.enabled is trueobjectsee values.yaml
extraVolumeMountsExtra Volume mountslist[]
extraVolumesExtra Volumeslist[]
fullnameOverrideFull name overrie for releasestring""
image.pullPolicyImage pull policystring"IfNotPresent"
image.repositoryGrafana Agent imagestring"grafana/agent"
image.tagOverrides the image tag whose default is the chart appVersion.string""
imagePullSecretsPull secret for private repositorylist[]
nameOverrideRelease name overridestring""
nodeSelectorPod node selectorobject{}
podAnnotationsPod annotationsobject{}
podSecurityContextPod Security Contextobject{}
replicaCountNumber of replicas of Grafana Agent deployment (only relevant for service scraping mode)int3
resourcesKubernetes pod resourcesobject{}
scrapingServiceMode.enabledEnabled scraping service mode. See below for more detailsboolfalse
securityContextContainer Security Contextobjectsee values.yaml
service.portKubernetes service portint80
service.typeService Typestring"ClusterIP"
serviceAccount.annotationsAnnotations to add to the service accountobject{}
serviceAccount.createSpecifies whether a service account should be createdbooltrue
serviceAccount.nameThe name of the service account to use. If not set and create is true, a name is generated using the fullname templatestring""
tolerationsPod tolerationslist[{"effect":"NoSchedule","operator":"Exists"}]
updateStrategyUpdate strategystring"Recreate"

Specify each parameter using the --set key=value[,key=value] argument to helm install. For example,

$ helm repo add dandydev https://dandydeveloper.github.io/charts
$ helm install \
  --set tag=1.7.0 \
    dandydev/grafana-agent

The above command deploys a DaemonSet of the Grafana Agent in the default namespace.

Scraping Service Mode

Scraping Service mode


Autogenerated from chart metadata using helm-docs

Deploy grafana-agent with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has grafana-agent on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartgrafana-agent is pinned at v0.19.2 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply