diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md
index 028843f283dcc..23113b35a662e 100644
--- a/docs/sources/setup/install/helm/reference.md
+++ b/docs/sources/setup/install/helm/reference.md
@@ -82,7 +82,8 @@ This is the generated reference for the Loki Helm Chart values.
"type": "RollingUpdate"
},
"terminationGracePeriodSeconds": 60,
- "tolerations": []
+ "tolerations": [],
+ "topologySpreadConstraints": []
}
@@ -280,6 +281,15 @@ This is the generated reference for the Loki Helm Chart values.
[]
+ |
+
+
+ adminApi.topologySpreadConstraints |
+ list |
+ Topology Spread Constraints for admin-api pods |
+
+[]
+
|
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 f85bbf90014b4..2d356882204b6 100644
--- a/production/helm/loki/templates/admin-api/deployment-admin-api.yaml
+++ b/production/helm/loki/templates/admin-api/deployment-admin-api.yaml
@@ -38,6 +38,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
+ {{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
+ {{- with .Values.adminApi.topologySpreadConstraints }}
+ topologySpreadConstraints:
+ {{- toYaml . | nindent 8 }}
+ {{- end }}
+ {{- end }}
serviceAccountName: {{ template "loki.serviceAccountName" . }}
{{- if .Values.adminApi.priorityClassName }}
priorityClassName: {{ .Values.adminApi.priorityClassName }}
@@ -167,4 +173,4 @@ spec:
path: CAs/public.crt
{{- end }}
{{- end }}
-{{- end }}
\ No newline at end of file
+{{- end }}
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index 7dbde9d9fed17..9ab4de54ba204 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -876,6 +876,8 @@ adminApi:
affinity: {}
# -- Node selector for admin-api Pods
nodeSelector: {}
+ # -- Topology Spread Constraints for admin-api pods
+ topologySpreadConstraints: []
# -- Tolerations for admin-api Pods
tolerations: []
# -- Grace period to allow the admin-api to shutdown before it is killed