From c474f265a7a36fc65270e4c28c447ebe6be440a7 Mon Sep 17 00:00:00 2001
From: Nils <20240901+Tolsto@users.noreply.github.com>
Date: Wed, 11 Jan 2023 14:20:13 +0100
Subject: [PATCH] Add config for optional pod labels (#7594)
---
docs/sources/installation/helm/reference.md | 49 ++++++++++++++++++-
.../templates/gateway/deployment-gateway.yaml | 6 +++
.../loki/templates/read/statefulset-read.yaml | 6 +++
.../templates/single-binary/statefulset.yaml | 6 +++
.../templates/write/statefulset-write.yaml | 6 +++
production/helm/loki/values.yaml | 14 +++++-
6 files changed, 83 insertions(+), 4 deletions(-)
diff --git a/docs/sources/installation/helm/reference.md b/docs/sources/installation/helm/reference.md
index 213406791b..635b5dca48 100644
--- a/docs/sources/installation/helm/reference.md
+++ b/docs/sources/installation/helm/reference.md
@@ -829,6 +829,15 @@ See values.yaml
{}
+ |
+
+
+ gateway.podLabels |
+ object |
+ Additional labels for gateway pods |
+
+{}
+
|
@@ -1451,6 +1460,15 @@ null
{}
+ |
+
+
+ loki.podLabels |
+ object |
+ Common labels for all pods |
+
+{}
+
|
@@ -2538,6 +2556,15 @@ null
{}
+ |
+
+
+ read.podLabels |
+ object |
+ Additional labels for each `read` pod |
+
+{}
+
|
@@ -2570,7 +2597,7 @@ null
read.selectorLabels |
object |
- Additional selecto labels for each `read` pod |
+ Additional selector labels for each `read` pod |
{}
@@ -2835,6 +2862,15 @@ null
|
{}
+ |
+
+
+ singleBinary.podLabels |
+ object |
+ Additional labels for each `single binary` pod |
+
+{}
+
|
@@ -2867,7 +2903,7 @@ null
singleBinary.selectorLabels |
object |
- Additional selecto labels for each `single binary` pod |
+ Additional selector labels for each `single binary` pod |
{}
@@ -3149,6 +3185,15 @@ null
|
{}
+ |
+
+
+ write.podLabels |
+ object |
+ Additional labels for each `write` pod |
+
+{}
+
|
diff --git a/production/helm/loki/templates/gateway/deployment-gateway.yaml b/production/helm/loki/templates/gateway/deployment-gateway.yaml
index 8620fa7235..4c1de31898 100644
--- a/production/helm/loki/templates/gateway/deployment-gateway.yaml
+++ b/production/helm/loki/templates/gateway/deployment-gateway.yaml
@@ -29,6 +29,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
+ {{- with .Values.loki.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.gateway.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
{{- include "loki.gatewaySelectorLabels" . | nindent 8 }}
spec:
serviceAccountName: {{ include "loki.serviceAccountName" . -}}
diff --git a/production/helm/loki/templates/read/statefulset-read.yaml b/production/helm/loki/templates/read/statefulset-read.yaml
index 13f0bea209..9cff8b8233 100644
--- a/production/helm/loki/templates/read/statefulset-read.yaml
+++ b/production/helm/loki/templates/read/statefulset-read.yaml
@@ -41,6 +41,12 @@ spec:
labels:
app.kubernetes.io/part-of: memberlist
{{- include "loki.readSelectorLabels" . | nindent 8 }}
+ {{- with .Values.loki.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.read.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
{{- with .Values.read.selectorLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
diff --git a/production/helm/loki/templates/single-binary/statefulset.yaml b/production/helm/loki/templates/single-binary/statefulset.yaml
index 30dccc6776..98c47db30b 100644
--- a/production/helm/loki/templates/single-binary/statefulset.yaml
+++ b/production/helm/loki/templates/single-binary/statefulset.yaml
@@ -31,6 +31,12 @@ spec:
{{- end }}
labels:
{{- include "loki.singleBinarySelectorLabels" . | nindent 8 }}
+ {{- with .Values.loki.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.singleBinary.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
{{- with .Values.singleBinary.selectorLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
diff --git a/production/helm/loki/templates/write/statefulset-write.yaml b/production/helm/loki/templates/write/statefulset-write.yaml
index b3af3f6e96..e5133f54f9 100644
--- a/production/helm/loki/templates/write/statefulset-write.yaml
+++ b/production/helm/loki/templates/write/statefulset-write.yaml
@@ -32,6 +32,12 @@ spec:
{{- end }}
labels:
{{- include "loki.writeSelectorLabels" . | nindent 8 }}
+ {{- with .Values.loki.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- with .Values.write.podLabels }}
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
{{- with .Values.write.selectorLabels }}
{{- tpl (toYaml .) $ | nindent 8 }}
{{- end }}
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index e242be3b61..ec5d1f9434 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -50,6 +50,8 @@ loki:
pullPolicy: IfNotPresent
# -- Common annotations for all pods
podAnnotations: {}
+ # -- Common labels for all pods
+ podLabels: {}
# -- The number of old ReplicaSets to retain to allow rollback
revisionHistoryLimit: 10
# -- The SecurityContext for Loki pods
@@ -751,6 +753,8 @@ write:
priorityClassName: null
# -- Annotations for write pods
podAnnotations: {}
+ # -- Additional labels for each `write` pod
+ podLabels: {}
# -- Additional selector labels for each `write` pod
selectorLabels: {}
# -- Labels for ingestor service
@@ -826,7 +830,9 @@ read:
priorityClassName: null
# -- Annotations for read pods
podAnnotations: {}
- # -- Additional selecto labels for each `read` pod
+ # -- Additional labels for each `read` pod
+ podLabels: {}
+ # -- Additional selector labels for each `read` pod
selectorLabels: {}
# -- Labels for read service
serviceLabels: {}
@@ -901,7 +907,9 @@ singleBinary:
priorityClassName: null
# -- Annotations for single binary pods
podAnnotations: {}
- # -- Additional selecto labels for each `single binary` pod
+ # -- Additional labels for each `single binary` pod
+ podLabels: {}
+ # -- Additional selector labels for each `single binary` pod
selectorLabels: {}
# -- Comma-separated list of Loki modules to load for the single binary
targetModule: "all"
@@ -1022,6 +1030,8 @@ gateway:
priorityClassName: null
# -- Annotations for gateway pods
podAnnotations: {}
+ # -- Additional labels for gateway pods
+ podLabels: {}
# -- Additional CLI args for the gateway
extraArgs: []
# -- Environment variables to add to the gateway pods