From e5f31b39f714fc065d360343163cfca9dbe58c85 Mon Sep 17 00:00:00 2001 From: Aaron Date: Thu, 13 Feb 2025 05:38:15 -0500 Subject: [PATCH] feat: helm global values updates (#16062) Signed-off-by: Aaron Signed-off-by: Poyzan <31743851+poyzannur@users.noreply.github.com> Co-authored-by: Poyzan <31743851+poyzannur@users.noreply.github.com> --- docs/sources/setup/install/helm/reference.md | 45 +++++++++++++++++++ production/helm/loki/CHANGELOG.md | 2 + .../admin-api/deployment-admin-api.yaml | 4 +- .../backend/statefulset-backend.yaml | 25 ++++------- .../deployment-bloom-builder.yaml | 17 +++---- .../statefulset-bloom-gateway.yaml | 17 +++---- .../statefulset-bloom-planner.yaml | 7 +-- .../compactor/statefulset-compactor.yaml | 17 +++---- .../distributor/deployment-distributor.yaml | 17 +++---- .../statefulset-index-gateway.yaml | 17 +++---- .../ingester/statefulset-ingester-zone-a.yaml | 17 +++---- .../ingester/statefulset-ingester-zone-b.yaml | 17 +++---- .../ingester/statefulset-ingester-zone-c.yaml | 17 +++---- .../ingester/statefulset-ingester.yaml | 17 +++---- .../deployment-overrides-exporter.yaml | 17 +++---- .../statefulset-pattern-ingester.yaml | 17 +++---- .../templates/querier/deployment-querier.yaml | 17 +++---- .../deployment-query-frontend.yaml | 17 +++---- .../deployment-query-scheduler.yaml | 17 +++---- .../loki/templates/read/statefulset-read.yaml | 20 +++------ .../templates/ruler/statefulset-ruler.yaml | 17 +++---- .../templates/write/statefulset-write.yaml | 20 +++------ production/helm/loki/values.yaml | 19 ++++++++ 23 files changed, 197 insertions(+), 200 deletions(-) diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md index 71b2675110726..19e0fcf7dddcb 100644 --- a/docs/sources/setup/install/helm/reference.md +++ b/docs/sources/setup/install/helm/reference.md @@ -4613,6 +4613,51 @@ true
 "kube-dns"
 
+ + + + global.extraArgs + list + 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. +
+[]
+
+ + + + global.extraEnv + list + 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. +
+[]
+
+ + + + global.extraEnvFrom + list + 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 +
+[]
+
+ + + + global.extraVolumeMounts + list + 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. +
+[]
+
+ + + + global.extraVolumes + list + 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. +
+[]
+
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md index 9c0b4eb851de8..395f6325489da 100644 --- a/production/helm/loki/CHANGELOG.md +++ b/production/helm/loki/CHANGELOG.md @@ -13,6 +13,8 @@ Entries should include a reference to the pull request that introduced the chang [//]: # ( : 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 diff --git a/production/helm/loki/templates/admin-api/deployment-admin-api.yaml b/production/helm/loki/templates/admin-api/deployment-admin-api.yaml index 7146ffb6588e6..75623bdbf8995 100644 --- a/production/helm/loki/templates/admin-api/deployment-admin-api.yaml +++ b/production/helm/loki/templates/admin-api/deployment-admin-api.yaml @@ -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 diff --git a/production/helm/loki/templates/backend/statefulset-backend.yaml b/production/helm/loki/templates/backend/statefulset-backend.yaml index bf2e18da80b4a..c0e1698290664 100644 --- a/production/helm/loki/templates/backend/statefulset-backend.yaml +++ b/production/helm/loki/templates/backend/statefulset-backend.yaml @@ -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 }} @@ -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" . }} @@ -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: @@ -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 }} @@ -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: @@ -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 }} diff --git a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml index c04b3ae5ae255..3a270086a4e38 100644 --- a/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml +++ b/production/helm/loki/templates/bloom-builder/deployment-bloom-builder.yaml @@ -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: @@ -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: @@ -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 }} @@ -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: @@ -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 -}} diff --git a/production/helm/loki/templates/bloom-gateway/statefulset-bloom-gateway.yaml b/production/helm/loki/templates/bloom-gateway/statefulset-bloom-gateway.yaml index 8c3f574f58de0..64acf38933473 100644 --- a/production/helm/loki/templates/bloom-gateway/statefulset-bloom-gateway.yaml +++ b/production/helm/loki/templates/bloom-gateway/statefulset-bloom-gateway.yaml @@ -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: @@ -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: @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/production/helm/loki/templates/bloom-planner/statefulset-bloom-planner.yaml b/production/helm/loki/templates/bloom-planner/statefulset-bloom-planner.yaml index 30e39a9d823af..2d115952c841f 100644 --- a/production/helm/loki/templates/bloom-planner/statefulset-bloom-planner.yaml +++ b/production/helm/loki/templates/bloom-planner/statefulset-bloom-planner.yaml @@ -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: diff --git a/production/helm/loki/templates/compactor/statefulset-compactor.yaml b/production/helm/loki/templates/compactor/statefulset-compactor.yaml index 987aae71233a6..368986a1e5b1c 100644 --- a/production/helm/loki/templates/compactor/statefulset-compactor.yaml +++ b/production/helm/loki/templates/compactor/statefulset-compactor.yaml @@ -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: @@ -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: @@ -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 }} @@ -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 }} @@ -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 }} diff --git a/production/helm/loki/templates/distributor/deployment-distributor.yaml b/production/helm/loki/templates/distributor/deployment-distributor.yaml index 556a0534f75cb..64d40c5c335ef 100644 --- a/production/helm/loki/templates/distributor/deployment-distributor.yaml +++ b/production/helm/loki/templates/distributor/deployment-distributor.yaml @@ -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: @@ -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: @@ -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 }} @@ -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: @@ -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 -}} diff --git a/production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml b/production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml index 269fa57ebed92..57384055f00e6 100644 --- a/production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml +++ b/production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml @@ -42,11 +42,8 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.indexGatewaySelectorLabels" . | nindent 8 }} - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.indexGateway.podLabels }} + {{- include "loki.indexGatewayLabels" . | nindent 8 }} + {{- with merge .Values.loki.podLabels .Values.indexGateway.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.indexGateway.joinMemberlist }} @@ -77,7 +74,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=index-gateway - {{- with .Values.indexGateway.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.indexGateway.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -92,11 +89,11 @@ spec: containerPort: 7946 protocol: TCP {{- end }} - {{- with .Values.indexGateway.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.indexGateway.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.indexGateway.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.indexGateway.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -117,7 +114,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.indexGateway.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.indexGateway.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -156,7 +153,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.indexGateway.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.indexGateway.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.indexGateway.persistence.enabled }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml index 095300e66a0f8..a67c17ec7d8b5 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml @@ -58,14 +58,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} + {{- include "loki.ingesterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist name: {{ include "loki.prefixIngesterName" . }}ingester-zone-a rollout-group: {{ include "loki.prefixRolloutGroup" . }}ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} + {{- with merge .Values.loki.podLabels .Values.ingester.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -106,7 +103,7 @@ spec: - -ingester.unregister-on-shutdown=false - -ingester.tokens-file-path=/var/loki/ring-tokens - -target=ingester - {{- with .Values.ingester.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.ingester.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -119,11 +116,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.ingester.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.ingester.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.ingester.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -142,7 +139,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.ingester.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ingester.resources }} @@ -196,7 +193,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.ingester.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.ingester.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.ingester.persistence.enabled }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml index da6d0dfb84746..5b66376a479d7 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml @@ -58,14 +58,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} + {{- include "loki.ingesterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist name: {{ include "loki.prefixIngesterName" . }}ingester-zone-b rollout-group: {{ include "loki.prefixRolloutGroup" . }}ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} + {{- with merge .Values.ingester.podLabels .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -106,7 +103,7 @@ spec: - -ingester.unregister-on-shutdown=false - -ingester.tokens-file-path=/var/loki/ring-tokens - -target=ingester - {{- with .Values.ingester.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.ingester.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -119,11 +116,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.ingester.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.ingester.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.ingester.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -142,7 +139,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.ingester.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ingester.resources }} @@ -196,7 +193,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.ingester.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.ingester.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.ingester.persistence.enabled }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml b/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml index 619db5e02ad03..803d230ec56ad 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml @@ -58,14 +58,11 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} + {{- include "loki.ingesterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist name: {{ include "loki.prefixIngesterName" . }}ingester-zone-c rollout-group: {{ include "loki.prefixRolloutGroup" . }}ingester - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} + {{- with merge .Values.ingester.podLabels .Values.loki.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -106,7 +103,7 @@ spec: - -ingester.unregister-on-shutdown=false - -ingester.tokens-file-path=/var/loki/ring-tokens - -target=ingester - {{- with .Values.ingester.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.ingester.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -119,11 +116,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.ingester.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.ingester.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.ingester.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -142,7 +139,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.ingester.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ingester.resources }} @@ -196,7 +193,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.ingester.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.ingester.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.ingester.persistence.enabled }} diff --git a/production/helm/loki/templates/ingester/statefulset-ingester.yaml b/production/helm/loki/templates/ingester/statefulset-ingester.yaml index c107492d8a860..f87f6ff6e6316 100644 --- a/production/helm/loki/templates/ingester/statefulset-ingester.yaml +++ b/production/helm/loki/templates/ingester/statefulset-ingester.yaml @@ -46,12 +46,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.ingesterSelectorLabels" . | nindent 8 }} + {{- include "loki.ingesterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ingester.podLabels }} + {{- with merge .Values.loki.podLabels .Values.ingester.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -90,7 +87,7 @@ spec: - -config.file=/etc/loki/config/config.yaml - -ingester.availability-zone=zone-default - -target=ingester - {{- with .Values.ingester.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.ingester.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -103,11 +100,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.ingester.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.ingester.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.ingester.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.ingester.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -126,7 +123,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.ingester.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.ingester.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.ingester.resources }} @@ -167,7 +164,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.ingester.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.ingester.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.ingester.persistence.enabled }} diff --git a/production/helm/loki/templates/overrides-exporter/deployment-overrides-exporter.yaml b/production/helm/loki/templates/overrides-exporter/deployment-overrides-exporter.yaml index 89b025ec66c02..e2d7419d19bc8 100644 --- a/production/helm/loki/templates/overrides-exporter/deployment-overrides-exporter.yaml +++ b/production/helm/loki/templates/overrides-exporter/deployment-overrides-exporter.yaml @@ -32,12 +32,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.overridesExporterSelectorLabels" . | nindent 8 }} + {{- include "loki.overridesExporterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.overridesExporter.podLabels }} + {{- with merge .Values.loki.podLabels .Values.overridesExporter.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -71,7 +68,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=overrides-exporter - {{- with .Values.overridesExporter.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.overridesExporter.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -84,11 +81,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.overridesExporter.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.overridesExporter.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.overridesExporter.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.overridesExporter.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -105,7 +102,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.overridesExporter.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.overridesExporter.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -140,7 +137,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.overridesExporter.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.overridesExporter.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- end -}} diff --git a/production/helm/loki/templates/pattern-ingester/statefulset-pattern-ingester.yaml b/production/helm/loki/templates/pattern-ingester/statefulset-pattern-ingester.yaml index a0b2b8f205fb6..9da958b0c9f94 100644 --- a/production/helm/loki/templates/pattern-ingester/statefulset-pattern-ingester.yaml +++ b/production/helm/loki/templates/pattern-ingester/statefulset-pattern-ingester.yaml @@ -39,12 +39,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.patternIngesterSelectorLabels" . | nindent 8 }} + {{- include "loki.patternIngesterLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.patternIngester.podLabels }} + {{- with merge .Values.loki.podLabels .Values.patternIngester.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -76,7 +73,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=pattern-ingester - {{- with .Values.patternIngester.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.patternIngester.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -89,11 +86,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.patternIngester.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.patternIngester.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.patternIngester.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.patternIngester.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -113,7 +110,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.patternIngester.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.patternIngester.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.patternIngester.resources }} @@ -160,7 +157,7 @@ spec: - name: data emptyDir: {} {{- end }} - {{- with .Values.patternIngester.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.patternIngester.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.patternIngester.persistence.enabled }} diff --git a/production/helm/loki/templates/querier/deployment-querier.yaml b/production/helm/loki/templates/querier/deployment-querier.yaml index 3165d0dfd39e0..80a677f4324ca 100644 --- a/production/helm/loki/templates/querier/deployment-querier.yaml +++ b/production/helm/loki/templates/querier/deployment-querier.yaml @@ -35,12 +35,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.querierSelectorLabels" . | nindent 8 }} + {{- include "loki.querierLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.querier.podLabels }} + {{- with merge .Values.loki.podLabels .Values.querier.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -81,7 +78,7 @@ spec: - -distributor.zone-awareness-enabled=true {{- end }} {{- end }} - {{- with .Values.querier.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.querier.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -94,11 +91,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.querier.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.querier.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.querier.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.querier.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -119,7 +116,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.querier.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.querier.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -160,7 +157,7 @@ spec: {{- end }} - name: data emptyDir: {} - {{- with .Values.querier.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.querier.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- end }} diff --git a/production/helm/loki/templates/query-frontend/deployment-query-frontend.yaml b/production/helm/loki/templates/query-frontend/deployment-query-frontend.yaml index 0b73fe8ae13b5..9f269047eea4e 100644 --- a/production/helm/loki/templates/query-frontend/deployment-query-frontend.yaml +++ b/production/helm/loki/templates/query-frontend/deployment-query-frontend.yaml @@ -34,12 +34,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.queryFrontendSelectorLabels" . | nindent 8 }} + {{- include "loki.queryFrontendLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.queryFrontend.podLabels }} + {{- with merge .Values.loki.podLabels .Values.queryFrontend.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -73,7 +70,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=query-frontend - {{- with .Values.queryFrontend.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.queryFrontend.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -86,11 +83,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.queryFrontend.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.queryFrontend.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.queryFrontend.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.queryFrontend.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -107,7 +104,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.queryFrontend.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.queryFrontend.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -142,7 +139,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.queryFrontend.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.queryFrontend.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- end -}} diff --git a/production/helm/loki/templates/query-scheduler/deployment-query-scheduler.yaml b/production/helm/loki/templates/query-scheduler/deployment-query-scheduler.yaml index fbb1f284c6416..871045ea4d4ec 100644 --- a/production/helm/loki/templates/query-scheduler/deployment-query-scheduler.yaml +++ b/production/helm/loki/templates/query-scheduler/deployment-query-scheduler.yaml @@ -32,11 +32,8 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.querySchedulerSelectorLabels" . | nindent 8 }} - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.queryScheduler.podLabels }} + {{- include "loki.querySchedulerLabels" . | nindent 8 }} + {{- with merge .Values.loki.podLabels .Values.queryScheduler.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} app.kubernetes.io/part-of: memberlist @@ -67,7 +64,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=query-scheduler - {{- with .Values.queryScheduler.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.queryScheduler.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -80,11 +77,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.queryScheduler.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.queryScheduler.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.queryScheduler.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.queryScheduler.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -103,7 +100,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.queryScheduler.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.queryScheduler.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} {{- with .Values.queryScheduler.resources }} @@ -140,7 +137,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.queryScheduler.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.queryScheduler.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- end }} diff --git a/production/helm/loki/templates/read/statefulset-read.yaml b/production/helm/loki/templates/read/statefulset-read.yaml index 93527f9d616da..1614248a2f70f 100644 --- a/production/helm/loki/templates/read/statefulset-read.yaml +++ b/production/helm/loki/templates/read/statefulset-read.yaml @@ -56,16 +56,10 @@ spec: {{- end }} labels: app.kubernetes.io/part-of: memberlist - {{- include "loki.readSelectorLabels" . | nindent 8 }} - {{- with .Values.loki.podLabels }} + {{- include "loki.readLabels" . | nindent 8 }} + {{- with merge .Values.loki.podLabels .Values.read.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.read.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.read.selectorLabels }} - {{- tpl (toYaml .) $ | nindent 8 }} - {{- end }} spec: serviceAccountName: {{ include "loki.serviceAccountName" . }} automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} @@ -85,7 +79,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target={{ .Values.read.targetModule }} - {{- with .Values.read.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.read.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -98,11 +92,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.read.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.read.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.read.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.read.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -127,7 +121,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end}} - {{- with .Values.read.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.read.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -172,7 +166,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.read.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.read.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} volumeClaimTemplates: diff --git a/production/helm/loki/templates/ruler/statefulset-ruler.yaml b/production/helm/loki/templates/ruler/statefulset-ruler.yaml index f17c4964bd067..d9e44da23f8d9 100644 --- a/production/helm/loki/templates/ruler/statefulset-ruler.yaml +++ b/production/helm/loki/templates/ruler/statefulset-ruler.yaml @@ -30,12 +30,9 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.rulerSelectorLabels" . | nindent 8 }} + {{- include "loki.rulerLabels" . | nindent 8 }} app.kubernetes.io/part-of: memberlist - {{- with .Values.loki.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.ruler.podLabels }} + {{- with merge .Values.loki.podLabels .Values.ruler.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} spec: @@ -69,7 +66,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target=ruler - {{- with .Values.ruler.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.ruler.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -82,11 +79,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.ruler.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.ruler.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.ruler.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.ruler.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -111,7 +108,7 @@ spec: - name: {{ include "loki.rulerRulesDirName" $dir }} mountPath: /etc/loki/rules/{{ $dir }} {{- end }} - {{- with .Values.ruler.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.ruler.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -157,7 +154,7 @@ spec: {{- end }} - name: tmp emptyDir: {} - {{- with .Values.ruler.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.ruler.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if not .Values.ruler.persistence.enabled }} diff --git a/production/helm/loki/templates/write/statefulset-write.yaml b/production/helm/loki/templates/write/statefulset-write.yaml index fc3b301354db8..83f3b2fae8d12 100644 --- a/production/helm/loki/templates/write/statefulset-write.yaml +++ b/production/helm/loki/templates/write/statefulset-write.yaml @@ -55,16 +55,10 @@ spec: {{- toYaml . | nindent 8 }} {{- end }} labels: - {{- include "loki.writeSelectorLabels" . | nindent 8 }} - {{- with .Values.loki.podLabels }} + {{- include "loki.writeLabels" . | nindent 8 }} + {{- with merge .Values.loki.podLabels .Values.write.podLabels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- with .Values.write.podLabels }} - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.write.selectorLabels }} - {{- tpl (toYaml .) $ | nindent 8 }} - {{- end }} app.kubernetes.io/part-of: memberlist spec: serviceAccountName: {{ include "loki.serviceAccountName" . }} @@ -91,7 +85,7 @@ spec: args: - -config.file=/etc/loki/config/config.yaml - -target={{ .Values.write.targetModule }} - {{- with .Values.write.extraArgs }} + {{- with (concat .Values.global.extraArgs .Values.write.extraArgs) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} ports: @@ -104,11 +98,11 @@ spec: - name: http-memberlist containerPort: 7946 protocol: TCP - {{- with .Values.write.extraEnv }} + {{- with (concat .Values.global.extraEnv .Values.write.extraEnv) | uniq }} env: {{- toYaml . | nindent 12 }} {{- end }} - {{- with .Values.write.extraEnvFrom }} + {{- with (concat .Values.global.extraEnvFrom .Values.write.extraEnvFrom) | uniq }} envFrom: {{- toYaml . | nindent 12 }} {{- end }} @@ -137,7 +131,7 @@ spec: - name: license mountPath: /etc/loki/license {{- end }} - {{- with .Values.write.extraVolumeMounts }} + {{- with (concat .Values.global.extraVolumeMounts .Values.write.extraVolumeMounts) | uniq }} {{- toYaml . | nindent 12 }} {{- end }} resources: @@ -184,7 +178,7 @@ spec: secretName: enterprise-logs-license {{- end }} {{- end }} - {{- with .Values.write.extraVolumes }} + {{- with (concat .Values.global.extraVolumes .Values.write.extraVolumes) | uniq }} {{- toYaml . | nindent 8 }} {{- end }} {{- if .Values.write.persistence.volumeClaimsEnabled }} diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 3b98fdb51549e..90cf0a7522e66 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -16,6 +16,25 @@ global: dnsService: "kube-dns" # -- configures DNS service namespace dnsNamespace: "kube-system" + # -- 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. + extraArgs: [] + # -- 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. + extraEnv: [] + # -- 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 + extraEnvFrom: [] + # -- 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. + extraVolumes: [] + # -- 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. + extraVolumeMounts: [] # -- Overrides the chart's name nameOverride: null # -- Overrides the chart's computed fullname