From b571a32a4bf428d341d8937d9a1cdc211f330d47 Mon Sep 17 00:00:00 2001 From: Fabien Culpo Date: Fri, 1 Mar 2024 15:19:59 +0100 Subject: [PATCH] Helm - allow loading all river files in a folder --- operations/helm/charts/grafana-agent/CHANGELOG.md | 4 ++++ .../charts/grafana-agent/templates/containers/_agent.yaml | 6 +++++- operations/helm/charts/grafana-agent/values.yaml | 6 +++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/operations/helm/charts/grafana-agent/CHANGELOG.md b/operations/helm/charts/grafana-agent/CHANGELOG.md index 009f7aaab8b9..e59154173f39 100644 --- a/operations/helm/charts/grafana-agent/CHANGELOG.md +++ b/operations/helm/charts/grafana-agent/CHANGELOG.md @@ -10,6 +10,10 @@ internal API changes are not present. Unreleased ---------- +### Features + +- Agent can load all river files located in `/etc/agent` (mounted via default or user provided configMap) instead of only one. This allows increased modularity, besides modules, and a terraform like behaviour. To enable it, set `.Values.agent.configMap.loadFolder` to `true`. (@fculpo) + 0.35.0 (2024-02-27) ------------------- diff --git a/operations/helm/charts/grafana-agent/templates/containers/_agent.yaml b/operations/helm/charts/grafana-agent/templates/containers/_agent.yaml index 0066f198ca0c..625a3985bc10 100644 --- a/operations/helm/charts/grafana-agent/templates/containers/_agent.yaml +++ b/operations/helm/charts/grafana-agent/templates/containers/_agent.yaml @@ -3,9 +3,13 @@ image: {{ .Values.global.image.registry | default .Values.image.registry }}/{{ .Values.image.repository }}{{ include "grafana-agent.imageId" . }} imagePullPolicy: {{ .Values.image.pullPolicy }} args: - {{- if eq .Values.agent.mode "flow"}} + {{- if eq .Values.agent.mode "flow" }} - run + {{- if .Values.agent.configMap.loadFolder }} + - /etc/agent/ + {{- else }} - /etc/agent/{{ include "grafana-agent.config-map.key" . }} + {{- end }} - --storage.path={{ .Values.agent.storagePath }} - --server.http.listen-addr={{ .Values.agent.listenAddr }}:{{ .Values.agent.listenPort }} - --server.http.ui-path-prefix={{ .Values.agent.uiPathPrefix }} diff --git a/operations/helm/charts/grafana-agent/values.yaml b/operations/helm/charts/grafana-agent/values.yaml index d481ae0ab290..210b1b3e7ac9 100644 --- a/operations/helm/charts/grafana-agent/values.yaml +++ b/operations/helm/charts/grafana-agent/values.yaml @@ -34,8 +34,12 @@ agent: # -- Name of existing ConfigMap to use. Used when create is false. name: null - # -- Key in ConfigMap to get config from. + # -- Key in ConfigMap to get config from. + # Ignored if loadFolder is true. key: null + # -- If true, agent will load all files in /etc/agent (mounted via the configMap). + # key will be ignored + loadFolder: false clustering: # -- Deploy agents in a cluster to allow for load distribution. Only