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

Helm - allow loading all alloy files in /etc/alloy #1016

Open
wants to merge 1 commit into
base: main
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
4 changes: 4 additions & 0 deletions operations/helm/charts/alloy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ internal API changes are not present.
Unreleased
----------

### Features

- Alloy can load all river files located in `/etc/alloy` (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.alloy.loadFolder` to `true`. (@fculpo)

0.3.2 (2024-05-30)
------------------

Expand Down
3 changes: 2 additions & 1 deletion operations/helm/charts/alloy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ useful if just using the default DaemonSet isn't sufficient.
| alloy.clustering.portName | string | `"http"` | Name for the port used for clustering, useful if running inside an Istio Mesh |
| alloy.configMap.content | string | `""` | Content to assign to the new ConfigMap. This is passed into `tpl` allowing for templating from values. |
| alloy.configMap.create | bool | `true` | Create a new ConfigMap for the config file. |
| alloy.configMap.key | string | `nil` | Key in ConfigMap to get config from. |
| alloy.configMap.key | string | `nil` | Key in ConfigMap to get config from. Ignored if loadFolder is true. |
| alloy.configMap.name | string | `nil` | Name of existing ConfigMap to use. Used when create is false. |
| alloy.enableReporting | bool | `true` | Enables sending Grafana Labs anonymous usage stats to help improve Grafana Alloy. |
| alloy.envFrom | list | `[]` | Maps all the keys on a ConfigMap or Secret as environment variables. https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.24/#envfromsource-v1-core |
Expand All @@ -47,6 +47,7 @@ useful if just using the default DaemonSet isn't sufficient.
| alloy.listenAddr | string | `"0.0.0.0"` | Address to listen for traffic on. 0.0.0.0 exposes the UI to other containers. |
| alloy.listenPort | int | `12345` | Port to listen for traffic on. |
| alloy.listenScheme | string | `"HTTP"` | Scheme is needed for readiness probes. If enabling tls in your configs, set to "HTTPS" |
| alloy.loadFolder | bool | `false` | If true, agent will load all files in /etc/alloy. alloy.configMap.key will be ignored |
| alloy.mounts.dockercontainers | bool | `false` | Mount /var/lib/docker/containers from the host into the container for log collection. |
| alloy.mounts.extra | list | `[]` | Extra volume mounts to add into the Grafana Alloy container. Does not affect the watch container. |
| alloy.mounts.varlog | bool | `false` | Mount /var/log from the host into the container for log collection. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- run
{{- if .Values.alloy.loadFolder }}
- /etc/alloy/
{{- else }}
- /etc/alloy/{{ include "alloy.config-map.key" . }}
{{- end }}
- --storage.path={{ $values.storagePath }}
- --server.http.listen-addr={{ $values.listenAddr }}:{{ $values.listenPort }}
- --server.http.ui-path-prefix={{ $values.uiPathPrefix }}
Expand Down
5 changes: 5 additions & 0 deletions operations/helm/charts/alloy/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ crds:
## chart, this field may also be called "agent". Naming this field "agent" is
## deprecated and will be removed in a future release.
alloy:
# -- If true, agent will load all files in /etc/alloy.
# alloy.configMap.key will be ignored
loadFolder: false

configMap:
# -- Create a new ConfigMap for the config file.
create: true
Expand All @@ -35,6 +39,7 @@ alloy:
# -- Name of existing ConfigMap to use. Used when create is false.
name: null
# -- Key in ConfigMap to get config from.
# Ignored if loadFolder is true.
key: null

clustering:
Expand Down