Skip to content

fix: add extraEnvFrom to the global variables in the helm chart #12652

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

Closed
wants to merge 12 commits into from
9 changes: 9 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4602,6 +4602,15 @@ true
<td><pre lang="json">
"kube-dns"
</pre>
</td>
</tr>
<tr>
<td>global.extraEnvFrom</td>
<td>list</td>
<td>Environment variables from secrets or configmaps to add to all pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down
3 changes: 3 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Entries should include a reference to the pull request that introduced the chang

[//]: # (<AUTOMATED_UPDATES_LOCATOR> : do not remove this line. This locator is used by the CI pipeline to automatically create a changelog entry for each new Loki release. Add other chart versions and respective changelog entries bellow this line.)

## 6.25.1
- [BUGFIX] Add extraEnvFrom to global variables (to conform with documentation)

## 6.25.0

- [BUGFIX] Removed minio-mc init container from admin-api.
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.
type: application
appVersion: 3.3.2
version: 6.25.0
version: 6.25.1
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# loki

![Version: 6.25.0](https://img.shields.io/badge/Version-6.25.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.3.2](https://img.shields.io/badge/AppVersion-3.3.2-informational?style=flat-square)
![Version: 6.25.1](https://img.shields.io/badge/Version-6.25.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 3.3.2](https://img.shields.io/badge/AppVersion-3.3.2-informational?style=flat-square)

Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple, scalable and distributed modes.

Expand All @@ -15,7 +15,7 @@ Helm chart for Grafana Loki and Grafana Enterprise Logs supporting both simple,
| Repository | Name | Version |
|------------|------|---------|
| https://charts.min.io/ | minio(minio) | 5.4.0 |
| https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.5.0 |
| https://grafana.github.io/helm-charts | grafana-agent-operator(grafana-agent-operator) | 0.5.1 |
| https://grafana.github.io/helm-charts | rollout_operator(rollout-operator) | 0.23.0 |

Find more information in the Loki Helm Chart [documentation](https://grafana.com/docs/loki/next/installation/helm).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,9 @@ spec:
{{- if .Values.adminApi.env }}
{{ toYaml .Values.adminApi.env | nindent 12 }}
{{- end }}
{{- with .Values.adminApi.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.adminApi.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.adminApi.extraEnvFrom .Values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
{{- with .Values.adminApi.extraContainers }}
{{ toYaml . | nindent 8 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.backend.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.backend.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.backend.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomBuilder.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.bloomBuilder.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.bloomBuilder.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomGateway.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.bloomGateway.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.bloomGateway.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomPlanner.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.bloomPlanner.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.bloomPlanner.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.compactor.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.compactor.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.compactor.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.distributor.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.distributor.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.distributor.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.gateway.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.gateway.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.gateway.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
readinessProbe:
{{- toYaml .Values.gateway.readinessProbe | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.indexGateway.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.indexGateway.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.indexGateway.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.ingester.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.ingester.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.ingester.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ingester.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.ingester.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.overridesExporter.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.overridesExporter.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.overridesExporter.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.patternIngester.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.patternIngester.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.patternIngester.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.querier.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.querier.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.querier.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.queryFrontend.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.queryFrontend.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.queryFrontend.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.queryScheduler.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.queryScheduler.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.queryScheduler.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/read/deployment-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.read.extraEnvFrom }}
{{- if or .Values.read.extraEnvFrom .Values.global.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.read.extraEnvFrom .Values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/read/statefulset-read.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.read.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.read.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.read.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/ruler/statefulset-ruler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.ruler.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.ruler.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.ruler.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.singleBinary.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.singleBinary.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.singleBinary.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.tableManager.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.tableManager.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.tableManager.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/tokengen/job-tokengen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,9 @@ spec:
{{- if .Values.enterprise.tokengen.env }}
{{ toYaml .Values.enterprise.tokengen.env | nindent 12 }}
{{- end }}
{{- with .Values.enterprise.tokengen.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.enterprise.tokengen.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.enterprise.tokengen.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
containers:
- name: create-secret
Expand Down
4 changes: 2 additions & 2 deletions production/helm/loki/templates/write/statefulset-write.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,9 @@ spec:
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.write.extraEnvFrom }}
{{- if or .Values.global.extraEnvFrom .Values.write.extraEnvFrom }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- coalesce .Values.write.extraEnvFrom .values.global.extraEnvFrom | toYaml | nindent 10 }}
{{- end }}
securityContext:
{{- toYaml .Values.loki.containerSecurityContext | nindent 12 }}
Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ global:
dnsService: "kube-dns"
# -- configures DNS service namespace
dnsNamespace: "kube-system"
# -- Environment variables from secrets or configmaps to add to all pods
extraEnvFrom: []
# -- Overrides the chart's name
nameOverride: null
# -- Overrides the chart's computed fullname
Expand Down