Skip to content

Commit

Permalink
feat: helm global values updates (#16062)
Browse files Browse the repository at this point in the history
Signed-off-by: Aaron <aaron.benton@grafana.com>
Signed-off-by: Poyzan <31743851+poyzannur@users.noreply.github.com>
Co-authored-by: Poyzan <31743851+poyzannur@users.noreply.github.com>
  • Loading branch information
bentonam and poyzannur authored Feb 13, 2025
1 parent 381323e commit e5f31b3
Show file tree
Hide file tree
Showing 23 changed files with 197 additions and 200 deletions.
45 changes: 45 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4613,6 +4613,51 @@ true
<td><pre lang="json">
"kube-dns"
</pre>
</td>
</tr>
<tr>
<td>global.extraArgs</td>
<td>list</td>
<td>Common additional CLI arguments for all jobs (that is, -log.level debug, -config.expand-env=true or -log-config-reverse-order) scope: admin-api, backend, bloom-builder, bloom-gateway, bloom-planner, compactor, distributor, index-gateway, ingester, overrides-exporter, pattern-ingester, querier, query-frontend, query-scheduler, read, ruler, write.</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>global.extraEnv</td>
<td>list</td>
<td>Common environment variables to add to all pods directly managed by this chart. scope: admin-api, backend, bloom-builder, bloom-gateway, bloom-planner, compactor, distributor, index-gateway, ingester, overrides-exporter, pattern-ingester, querier, query-frontend, query-scheduler, read, ruler, write.</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>global.extraEnvFrom</td>
<td>list</td>
<td>Common source of environment injections to add to all pods directly managed by this chart. scope: admin-api, backend, bloom-builder, bloom-gateway, bloom-planner, compactor, distributor, index-gateway, ingester, overrides-exporter, pattern-ingester, querier, query-frontend, query-scheduler, read, ruler, write. For example to inject values from a Secret, use: extraEnvFrom: - secretRef: name: mysecret</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>global.extraVolumeMounts</td>
<td>list</td>
<td>Common mount points to add to all pods directly managed by this chart. scope: admin-api, backend, bloom-builder, bloom-gateway, bloom-planner, compactor, distributor, index-gateway, ingester, overrides-exporter, pattern-ingester, querier, query-frontend, query-scheduler, read, ruler, write.</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>global.extraVolumes</td>
<td>list</td>
<td>Common volumes to add to all pods directly managed by this chart. scope: admin-api, backend, bloom-builder, bloom-gateway, bloom-planner, compactor, distributor, index-gateway, ingester, overrides-exporter, pattern-ingester, querier, query-frontend, query-scheduler, read, ruler, write.</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down
2 changes: 2 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ 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.)

- [FEATURE] Added support for globals: `extraArgs`, `extraEnv`, `extraEnvFrom`, `extraVolumes`, `extraVolumeMounts` ([#16062](https://github.com/grafana/loki/pull/16062)) relates to ([#12652](https://github.com/grafana/loki/pull/12652))

## 6.26.0

- [CHANGE] Changed version of Grafana Loki to 3.4.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ spec:
template:
metadata:
labels:
{{- include "enterprise-logs.adminApiSelectorLabels" . | nindent 8 }}
{{- with .Values.adminApi.labels }}
{{- include "enterprise-logs.adminApiLabels" . | nindent 8 }}
{{- with merge .Values.loki.podLabels .Values.adminApi.labels }}
{{- toYaml . | nindent 8 }}
{{- end }}
app.kubernetes.io/part-of: memberlist
Expand Down
25 changes: 8 additions & 17 deletions production/helm/loki/templates/backend/statefulset-backend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@ metadata:
app.kubernetes.io/part-of: memberlist
{{- if or (not (empty .Values.loki.annotations)) (not (empty .Values.backend.annotations))}}
annotations:
{{- with .Values.loki.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.backend.annotations }}
{{- with merge .Values.loki.annotations .Values.backend.annotations }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Expand Down Expand Up @@ -55,16 +52,10 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.backendSelectorLabels" . | nindent 8 }}
{{- with .Values.loki.podLabels }}
{{- include "loki.backendLabels" . | nindent 8 }}
{{- with merge .Values.loki.podLabels .Values.backend.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.selectorLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
app.kubernetes.io/part-of: memberlist
spec:
serviceAccountName: {{ include "loki.serviceAccountName" . }}
Expand Down Expand Up @@ -160,7 +151,7 @@ spec:
- -config.file=/etc/loki/config/config.yaml
- -target={{ .Values.backend.targetModule }}
- -legacy-read-mode=false
{{- with .Values.backend.extraArgs }}
{{- with (concat .Values.global.extraArgs .Values.backend.extraArgs) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -173,11 +164,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.backend.extraEnv }}
{{- with (concat .Values.global.extraEnv .Values.backend.extraEnv) | uniq }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.backend.extraEnvFrom }}
{{- with (concat .Values.global.extraEnv .Values.backend.extraEnvFrom) | uniq }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -202,7 +193,7 @@ spec:
- name: sc-rules-volume
mountPath: {{ .Values.sidecar.rules.folder | quote }}
{{- end}}
{{- with .Values.backend.extraVolumeMounts }}
{{- with (concat .Values.global.extraVolumeMounts .Values.backend.extraVolumeMounts) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
Expand Down Expand Up @@ -257,7 +248,7 @@ spec:
emptyDir: {}
{{- end -}}
{{- end -}}
{{- with .Values.backend.extraVolumes }}
{{- with (concat .Values.global.extraVolumes .Values.backend.extraVolumes) | uniq }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.backend.persistence.volumeClaimsEnabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.bloomBuilderSelectorLabels" . | nindent 8 }}
{{- include "loki.bloomBuilderLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.bloomBuilder.podLabels }}
{{- with merge .Values.loki.podLabels .Values.bloomBuilder.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down Expand Up @@ -67,7 +64,7 @@ spec:
args:
- -config.file=/etc/loki/config/config.yaml
- -target=bloom-builder
{{- with .Values.bloomBuilder.extraArgs }}
{{- with (concat .Values.global.extraArgs .Values.bloomBuilder.extraArgs) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -80,11 +77,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.bloomBuilder.extraEnv }}
{{- with (concat .Values.global.extraEnv .Values.bloomBuilder.extraEnv) | uniq }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomBuilder.extraEnvFrom }}
{{- with (concat .Values.global.extraEnvFrom .Values.bloomBuilder.extraEnvFrom) | uniq }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -105,7 +102,7 @@ spec:
mountPath: /tmp
- name: data
mountPath: /var/loki
{{- with .Values.bloomBuilder.extraVolumeMounts }}
{{- with (concat .Values.global.extraVolumeMounts .Values.bloomBuilder.extraVolumeMounts) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
Expand Down Expand Up @@ -144,7 +141,7 @@ spec:
emptyDir: {}
- name: data
emptyDir: {}
{{- with .Values.bloomBuilder.extraVolumes }}
{{- with (concat .Values.global.extraVolumes .Values.bloomBuilder.extraVolumes) | uniq }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.bloomGatewaySelectorLabels" . | nindent 8 }}
{{- include "loki.bloomGatewayLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.bloomGateway.podLabels }}
{{- with merge .Values.loki.podLabels .Values.bloomGateway.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down Expand Up @@ -75,7 +72,7 @@ spec:
args:
- -config.file=/etc/loki/config/config.yaml
- -target=bloom-gateway
{{- with .Values.bloomGateway.extraArgs }}
{{- with (concat .Values.global.extraArgs .Values.bloomGateway.extraArgs) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -88,11 +85,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.bloomGateway.extraEnv }}
{{- with (concat .Values.global.extraEnv .Values.bloomGateway.extraEnv) | uniq }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomGateway.extraEnvFrom }}
{{- with (concat .Values.global.extraEnvFrom .Values.bloomGateway.extraEnvFrom) | uniq }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -112,7 +109,7 @@ spec:
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- with .Values.bloomGateway.extraVolumeMounts }}
{{- with (concat .Values.global.extraVolumeMounts .Values.bloomGateway.extraVolumeMounts) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.bloomGateway.resources }}
Expand Down Expand Up @@ -155,7 +152,7 @@ spec:
- name: data
emptyDir: {}
{{- end }}
{{- with .Values.bloomGateway.extraVolumes }}
{{- with (concat .Values.global.extraVolumes .Values.bloomGateway.extraVolumes) | uniq }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.bloomGateway.persistence.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.bloomPlannerSelectorLabels" . | nindent 8 }}
{{- include "loki.bloomPlannerLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.bloomPlanner.podLabels }}
{{- with merge .Values.loki.podLabels .Values.bloomPlanner.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.compactorSelectorLabels" . | nindent 8 }}
{{- include "loki.compactorLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.compactor.podLabels }}
{{- with merge .Values.loki.podLabels .Values.compactor.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down Expand Up @@ -82,7 +79,7 @@ spec:
args:
- -config.file=/etc/loki/config/config.yaml
- -target=compactor
{{- with .Values.compactor.extraArgs }}
{{- with (concat .Values.global.extraArgs .Values.compactor.extraArgs) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -95,11 +92,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.compactor.extraEnv }}
{{- with (concat .Values.global.extraEnv .Values.compactor.extraEnv) | uniq }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.compactor.extraEnvFrom }}
{{- with (concat .Values.global.extraEnvFrom .Values.compactor.extraEnvFrom) | uniq }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -120,7 +117,7 @@ spec:
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- with .Values.compactor.extraVolumeMounts }}
{{- with (concat .Values.global.extraVolumeMounts .Values.compactor.extraVolumeMounts) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.compactor.resources }}
Expand Down Expand Up @@ -167,7 +164,7 @@ spec:
- name: data
emptyDir: {}
{{- end }}
{{- with .Values.compactor.extraVolumes }}
{{- with (concat .Values.global.extraVolumes .Values.compactor.extraVolumes) | uniq }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.compactor.persistence.enabled }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "loki.distributorSelectorLabels" . | nindent 8 }}
{{- include "loki.distributorLabels" . | nindent 8 }}
app.kubernetes.io/part-of: memberlist
{{- with .Values.loki.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.distributor.podLabels }}
{{- with merge .Values.loki.podLabels .Values.distributor.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
Expand Down Expand Up @@ -81,7 +78,7 @@ spec:
- -distributor.zone-awareness-enabled=true
{{- end }}
{{- end }}
{{- with .Values.distributor.extraArgs }}
{{- with (concat .Values.global.extraArgs .Values.distributor.extraArgs) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
ports:
Expand All @@ -94,11 +91,11 @@ spec:
- name: http-memberlist
containerPort: 7946
protocol: TCP
{{- with .Values.distributor.extraEnv }}
{{- with (concat .Values.global.extraEnv .Values.distributor.extraEnv) | uniq }}
env:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.distributor.extraEnvFrom }}
{{- with (concat .Values.global.extraEnvFrom .Values.distributor.extraEnvFrom) | uniq }}
envFrom:
{{- toYaml . | nindent 12 }}
{{- end }}
Expand All @@ -117,7 +114,7 @@ spec:
- name: license
mountPath: /etc/loki/license
{{- end }}
{{- with .Values.distributor.extraVolumeMounts }}
{{- with (concat .Values.global.extraVolumeMounts .Values.distributor.extraVolumeMounts) | uniq }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
Expand Down Expand Up @@ -152,7 +149,7 @@ spec:
secretName: enterprise-logs-license
{{- end }}
{{- end }}
{{- with .Values.distributor.extraVolumes }}
{{- with (concat .Values.global.extraVolumes .Values.distributor.extraVolumes) | uniq }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
Loading

0 comments on commit e5f31b3

Please sign in to comment.