Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(grafana-agent): Introduce helm-docs #281

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions charts/grafana-agent/.helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
.idea/
*.tmproj
.vscode/
*.gotmpl
2 changes: 1 addition & 1 deletion charts/grafana-agent/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: grafana-agent
description: Deploy an instance of the Grafana agent on all appropriate nodes for scraping Prometheus metrics.
type: application
home: https://grafana.com/docs/agent/latest/
version: 0.19.1
version: 0.19.2
appVersion: "v0.20.0"
keywords:
- monitoring
Expand Down
73 changes: 42 additions & 31 deletions charts/grafana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,45 @@ The command removes all the Kubernetes components associated with the chart and

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

| Parameter | Description | Default |
|:--------------------------|:-----------------------------------------------------------------------------------------------------------------------------------------------------|:-------------------------------------------------------------------------------|
| `image.repository` | Grafana Agent image | `grafana/agent` |
| `image.pullPolicy` | Image pull policy | `IfNotPresent` |
| `image.tag` | Grafana Agent tag | `` |
| `imagePullSecrets` | Pull secret for private repository | [] |
| `nameOverride` | Release name override | `` |
| `fullnameOverride` | Full name overrie for release | `` |
| `extraVolumeMounts` | Extra Volume mounts | `[]` |
| `extraVolumes` | Extra Volume | `[]` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.name` | The name of the ServiceAccount to create | Generated using the grafana-agent.fullname template |
| `serviceAccount.annotations` | Service Account annotations | `{}` |
| `replicaCount` | Number of replicas of Grafana Agent deployment (only relevant for service scraping mode) | `3` |
| `podAnnotations` | Pod annotations | `{}` |
| `podSecurityContext` | Pod Security Context | `{}` |
| `securityContext.privileged` | Run as privileged user | `true` |
| `service.type` | Service Type | `ClusterIP` |
| `service.port` | Kubernetes service port | `80` |
| `resources` | Kubernetes pod resources | `{}` |
| `nodeSelector` | Pod node selector | `{}` |
| `config.logLevel` | Server log_level | `info` |
| `config.existingConfigMap` | An existing ConfigMap entity that already exists, or is deployed by a parent chart | `""` |
| `config.prometheus.walDir` | Directory mount point for Grafana Agent WAL | `/var/lib/agent/data` |
| `config.prometheus.remoteWrite.url` | URL for the upstream federated Prometheus / Cortex instance | `""` |
| `config.prometheus.remoteWrite.auth.username` | Remote write username | `nil` |
| `config.prometheus.remoteWrite.auth.password` | Remote write password | `nil` |
| `config.prometheus.scrapeInterval` | Global scrape interval | `15s` |
| `config.prometheus.externalLabels` | External labels | `{}` |
| `config.prometheus.configs`| Scrape configs / General configs for the Prometheus scraping | `[]` |
| `scrapingServiceMode.enabled` | Enabled scraping service mode. See below for more details | `false` |
| Parameter | Description | Type | Default |
|-----|------|---------|-------------|
| `affinity` | Affinity rules | object | `{}` |
| `config.existingConfigMap` | An 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.logLevel` | Server log_level | string | `"info"` |
| `config.loki.configs` | Loki config content | string | see values.yaml |
| `config.loki.enabled` | Enable Loki config | bool | `true` |
| `config.prometheus.configs` | Scrape configs / General configs for the Prometheus scraping | string | see values.yaml |
| `config.prometheus.enabled` | Enable Prometheus config | bool | `true` |
| `config.prometheus.externalLabels` | External labels | object | `{}` |
| `config.prometheus.remoteWrite.auth` | Remote write username/password | string | `nil` |
| `config.prometheus.remoteWrite.url` | URL for the upstream federated Prometheus / Cortex instance | string | `"http://cortex.default.svc.cluster.local"` |
| `config.prometheus.scrapeInterval` | Global scrape interval | string | `"15s"` |
| `config.prometheus.walDir` | Directory mount point for Grafana Agent WAL | string | `"/var/lib/agent/data"` |
| `config.tempo.configs` | Tempo config content | string | see values.yaml |
| `config.tempo.enabled` | Enable Tempo config | bool | `true` |
| `consul` | Configure consul subchart resp. dependency chart Only deployed when scrapingServiceMode.enabled is true | object | see values.yaml |
| `extraVolumeMounts` | Extra Volume mounts | list | `[]` |
| `extraVolumes` | Extra Volumes | list | `[]` |
| `fullnameOverride` | Full name overrie for release | string | `""` |
| `image.pullPolicy` | Image pull policy | string | `"IfNotPresent"` |
| `image.repository` | Grafana Agent image | string | `"grafana/agent"` |
| `image.tag` | Overrides the image tag whose default is the chart appVersion. | string | `""` |
| `imagePullSecrets` | Pull secret for private repository | list | `[]` |
| `nameOverride` | Release name override | string | `""` |
| `nodeSelector` | Pod node selector | object | `{}` |
| `podAnnotations` | Pod annotations | object | `{}` |
| `podSecurityContext` | Pod Security Context | object | `{}` |
| `replicaCount` | Number of replicas of Grafana Agent deployment (only relevant for service scraping mode) | int | `3` |
| `resources` | Kubernetes pod resources | object | `{}` |
| `scrapingServiceMode.enabled` | Enabled scraping service mode. See below for more details | bool | `false` |
| `securityContext` | Container Security Context | object | see values.yaml |
| `service.port` | Kubernetes service port | int | `80` |
| `service.type` | Service Type | string | `"ClusterIP"` |
| `serviceAccount.annotations` | Annotations to add to the service account | object | `{}` |
| `serviceAccount.create` | Specifies whether a service account should be created | bool | `true` |
| `serviceAccount.name` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template | string | `""` |
| `tolerations` | Pod tolerations | list | `[{"effect":"NoSchedule","operator":"Exists"}]` |
| `updateStrategy` | Update strategy | string | `"Recreate"` |

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

Expand All @@ -88,3 +96,6 @@ The above command deploys a DaemonSet of the Grafana Agent in the `default` name

# Scraping Service Mode
[Scraping Service mode](https://grafana.com/docs/agent/latest/scraping-service/)

----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)
67 changes: 67 additions & 0 deletions charts/grafana-agent/README.md.gotmpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Grafana Agent

[Grafana Agent](https://grafana.com/docs/agent/latest/) 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

```bash
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](https://grafana.com/docs/agent/latest/).

## Prerequisites

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

## Installing the Chart

To install the chart

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

## Uninstalling the Chart

To uninstall/delete the deployment:

```bash
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.

| Parameter | Description | Type | Default |
|-----|------|---------|-------------|
{{- range .Values }}
| `{{ .Key }}` | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} |
{{- end }}

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

```bash
$ 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](https://grafana.com/docs/agent/latest/scraping-service/)

----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)
48 changes: 42 additions & 6 deletions charts/grafana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,21 @@
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
image:
# -- Grafana Agent image
repository: grafana/agent
# -- Image pull policy
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
# -- Overrides the image tag whose default is the chart appVersion.
tag: ""

# -- Pull secret for private repository
imagePullSecrets: []
# -- Release name override
nameOverride: ""
# -- Full name overrie for release
fullnameOverride: ""

# -- Extra Volume mounts
extraVolumeMounts: []
# Scrape k8s logs
# - name: containers
Expand All @@ -20,6 +26,7 @@ extraVolumeMounts: []
# mountPath: /var/log/pods
# readOnly: true

# -- Extra Volumes
extraVolumes: []
# Scrape k8s logs
#- name: containers
Expand All @@ -29,34 +36,41 @@ extraVolumes: []
# hostPath:
# path: /var/log/pods

# Only relevant if scrapingMode.enabled is true
# Delcares # of replicas for Grafana Agent deployment
# -- Number of replicas of Grafana Agent deployment (only relevant for service scraping mode)
replicaCount: 3

# -- Update strategy
updateStrategy: Recreate

serviceAccount:
# Specifies whether a service account should be created
# -- Specifies whether a service account should be created
create: true
# Annotations to add to the service account
# -- Annotations to add to the service account
annotations: {}
# The name of the service account to use.
# -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name: ""

# -- Pod annotations
podAnnotations: {}

# -- Pod Security Context
podSecurityContext: {}
# fsGroup: 2000

# -- Container Security Context
# @default -- see values.yaml
securityContext:
privileged: true
runAsUser: 0

service:
# -- Service Type
type: ClusterIP
# -- Kubernetes service port
port: 80

# -- Kubernetes pod resources
resources: {}
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
Expand All @@ -69,22 +83,30 @@ resources: {}
# cpu: 100m
# memory: 128Mi

# -- Pod node selector
nodeSelector: {}

# -- Pod tolerations
tolerations:
- effect: NoSchedule
operator: Exists

# -- Affinity rules
affinity: {}

# Currently only supports Prometheus 'configs'.
# Other telemetary options will be added overtime.
config:
# -- Server log_level
logLevel: info
# -- An 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.
existingConfigMap: ""
loki:
# -- Enable Loki config
enabled: true
# -- Loki config content
# @default -- see values.yaml
configs: |
positions_directory: /tmp/loki-positions
configs:
Expand All @@ -99,7 +121,10 @@ config:
job: varlogs
__path__: /var/log/*log
tempo:
# -- Enable Tempo config
enabled: true
# -- Tempo config content
# @default -- see values.yaml
configs: |
- name: default
receivers:
Expand All @@ -124,15 +149,23 @@ config:
processes: true
roots: true
prometheus:
# -- Enable Prometheus config
enabled: true
# -- Directory mount point for Grafana Agent WAL
walDir: /var/lib/agent/data
# -- Global scrape interval
scrapeInterval: 15s
# -- External labels
externalLabels: {}
remoteWrite:
# -- URL for the upstream federated Prometheus / Cortex instance
url: http://cortex.default.svc.cluster.local
# -- Remote write username/password
auth:
# username: ""
# password: ""
# -- Scrape configs / General configs for the Prometheus scraping
# @default -- see values.yaml
configs: |
- name: agent
remote_write:
Expand All @@ -156,8 +189,11 @@ config:
# Enables separation of ConfigMap for Agent expectations
# Also enables Consul for hash ring
scrapingServiceMode:
# -- Enabled scraping service mode. See below for more details
enabled: false

# -- Configure consul subchart resp. dependency chart
# @default -- see values.yaml
# Only deployed when scrapingServiceMode.enabled is true
consul:
client:
Expand Down