Skip to content

Commit d075107

Browse files
authored
feat: expose topologySpreadConstraints for distributed deployment (#14853)
1 parent a8f7851 commit d075107

File tree

16 files changed

+136
-12
lines changed

16 files changed

+136
-12
lines changed

‎docs/sources/setup/install/helm/reference.md‎

Lines changed: 75 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2695,7 +2695,8 @@ null
26952695
"serviceAnnotations": {},
26962696
"serviceLabels": {},
26972697
"terminationGracePeriodSeconds": 30,
2698-
"tolerations": []
2698+
"tolerations": [],
2699+
"topologySpreadConstraints": []
26992700
}
27002701
</pre>
27012702
</td>
@@ -3015,6 +3016,15 @@ null
30153016
<td><pre lang="json">
30163017
[]
30173018
</pre>
3019+
</td>
3020+
</tr>
3021+
<tr>
3022+
<td>distributor.topologySpreadConstraints</td>
3023+
<td>list</td>
3024+
<td>Topology Spread Constraints for distributor pods</td>
3025+
<td><pre lang="json">
3026+
[]
3027+
</pre>
30183028
</td>
30193029
</tr>
30203030
<tr>
@@ -3658,6 +3668,7 @@ false
36583668
},
36593669
"terminationGracePeriodSeconds": 60,
36603670
"tolerations": [],
3671+
"topologySpreadConstraints": [],
36613672
"useDefaultProxyURLs": true
36623673
}
36633674
</pre>
@@ -3858,6 +3869,15 @@ false
38583869
<td><pre lang="json">
38593870
[]
38603871
</pre>
3872+
</td>
3873+
</tr>
3874+
<tr>
3875+
<td>enterpriseGateway.topologySpreadConstraints</td>
3876+
<td>list</td>
3877+
<td>Topology Spread Constraints for enterprise-gateway pods</td>
3878+
<td><pre lang="json">
3879+
[]
3880+
</pre>
38613881
</td>
38623882
</tr>
38633883
<tr>
@@ -4658,6 +4678,7 @@ null
46584678
"serviceLabels": {},
46594679
"terminationGracePeriodSeconds": 300,
46604680
"tolerations": [],
4681+
"topologySpreadConstraints": [],
46614682
"updateStrategy": {
46624683
"type": "RollingUpdate"
46634684
}
@@ -4944,6 +4965,15 @@ null
49444965
<td><pre lang="json">
49454966
[]
49464967
</pre>
4968+
</td>
4969+
</tr>
4970+
<tr>
4971+
<td>indexGateway.topologySpreadConstraints</td>
4972+
<td>list</td>
4973+
<td>Topology Spread Constraints for index-gateway pods</td>
4974+
<td><pre lang="json">
4975+
[]
4976+
</pre>
49474977
</td>
49484978
</tr>
49494979
<tr>
@@ -7686,7 +7716,8 @@ false
76867716
"serviceAnnotations": {},
76877717
"serviceLabels": {},
76887718
"terminationGracePeriodSeconds": 30,
7689-
"tolerations": []
7719+
"tolerations": [],
7720+
"topologySpreadConstraints": []
76907721
}
76917722
</pre>
76927723
</td>
@@ -8015,6 +8046,15 @@ null
80158046
<td><pre lang="json">
80168047
[]
80178048
</pre>
8049+
</td>
8050+
</tr>
8051+
<tr>
8052+
<td>patternIngester.topologySpreadConstraints</td>
8053+
<td>list</td>
8054+
<td>Topology Spread Constraints for pattern ingester pods</td>
8055+
<td><pre lang="json">
8056+
[]
8057+
</pre>
80188058
</td>
80198059
</tr>
80208060
<tr>
@@ -8541,7 +8581,8 @@ Defaults to allow skew no more then 1 node
85418581
"serviceAnnotations": {},
85428582
"serviceLabels": {},
85438583
"terminationGracePeriodSeconds": 30,
8544-
"tolerations": []
8584+
"tolerations": [],
8585+
"topologySpreadConstraints": []
85458586
}
85468587
</pre>
85478588
</td>
@@ -8852,6 +8893,15 @@ null
88528893
<td><pre lang="json">
88538894
[]
88548895
</pre>
8896+
</td>
8897+
</tr>
8898+
<tr>
8899+
<td>queryFrontend.topologySpreadConstraints</td>
8900+
<td>list</td>
8901+
<td>Topology Spread Constraints for query-frontend pods</td>
8902+
<td><pre lang="json">
8903+
[]
8904+
</pre>
88558905
</td>
88568906
</tr>
88578907
<tr>
@@ -8899,7 +8949,8 @@ null
88998949
"serviceAnnotations": {},
89008950
"serviceLabels": {},
89018951
"terminationGracePeriodSeconds": 30,
8902-
"tolerations": []
8952+
"tolerations": [],
8953+
"topologySpreadConstraints": []
89038954
}
89048955
</pre>
89058956
</td>
@@ -9111,6 +9162,15 @@ null
91119162
<td><pre lang="json">
91129163
[]
91139164
</pre>
9165+
</td>
9166+
</tr>
9167+
<tr>
9168+
<td>queryScheduler.topologySpreadConstraints</td>
9169+
<td>list</td>
9170+
<td>Topology Spread Constraints for query-scheduler pods</td>
9171+
<td><pre lang="json">
9172+
[]
9173+
</pre>
91149174
</td>
91159175
</tr>
91169176
<tr>
@@ -10008,7 +10068,8 @@ null
1000810068
"serviceAnnotations": {},
1000910069
"serviceLabels": {},
1001010070
"terminationGracePeriodSeconds": 300,
10011-
"tolerations": []
10071+
"tolerations": [],
10072+
"topologySpreadConstraints": []
1001210073
}
1001310074
</pre>
1001410075
</td>
@@ -10301,6 +10362,15 @@ null
1030110362
<td><pre lang="json">
1030210363
[]
1030310364
</pre>
10365+
</td>
10366+
</tr>
10367+
<tr>
10368+
<td>ruler.topologySpreadConstraints</td>
10369+
<td>list</td>
10370+
<td>Topology Spread Constraints for ruler pods</td>
10371+
<td><pre lang="json">
10372+
[]
10373+
</pre>
1030410374
</td>
1030510375
</tr>
1030610376
<tr>

‎production/helm/loki/CHANGELOG.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Entries should include a reference to the pull request that introduced the chang
1313

1414
[//]: # (<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.)
1515

16+
- [ENHANCEMENT] Expose Topology Spread Constraints in Helm chart templates and default values.
17+
1618
## 6.19.0
1719

1820
## 6.18.0

‎production/helm/loki/templates/compactor/statefulset-compactor.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ spec:
4848
{{- toYaml . | nindent 8 }}
4949
{{- end }}
5050
spec:
51-
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
51+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
5252
{{- with .Values.compactor.topologySpreadConstraints }}
5353
topologySpreadConstraints:
5454
{{- tpl . $ | nindent 8 }}

‎production/helm/loki/templates/distributor/deployment-distributor.yaml‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ spec:
4444
{{- toYaml . | nindent 8 }}
4545
{{- end }}
4646
spec:
47+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
48+
{{- with .Values.distributor.topologySpreadConstraints }}
49+
topologySpreadConstraints:
50+
{{- toYaml . | nindent 8 }}
51+
{{- end }}
52+
{{- end }}
4753
serviceAccountName: {{ include "loki.serviceAccountName" . }}
4854
{{- with .Values.imagePullSecrets }}
4955
imagePullSecrets:

‎production/helm/loki/templates/gateway/deployment-gateway-enterprise.yaml‎

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,12 @@ spec:
3838
{{- toYaml . | nindent 8 }}
3939
{{- end }}
4040
spec:
41+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
42+
{{- with .Values.enterpriseGateway.topologySpreadConstraints }}
43+
topologySpreadConstraints:
44+
{{- toYaml . | nindent 8 }}
45+
{{- end }}
46+
{{- end }}
4147
serviceAccountName: {{ template "loki.serviceAccountName" . }}
4248
{{- if .Values.enterpriseGateway.priorityClassName }}
4349
priorityClassName: {{ .Values.enterpriseGateway.priorityClassName }}
@@ -143,4 +149,4 @@ spec:
143149
{{- if .Values.enterpriseGateway.extraVolumes }}
144150
{{ toYaml .Values.enterpriseGateway.extraVolumes | nindent 8 }}
145151
{{- end }}
146-
{{- end }}
152+
{{- end }}

‎production/helm/loki/templates/index-gateway/statefulset-index-gateway.yaml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,10 @@ spec:
132132
nodeSelector:
133133
{{- toYaml . | nindent 8 }}
134134
{{- end }}
135+
{{- with .Values.indexGateway.topologySpreadConstraints }}
136+
topologySpreadConstraints:
137+
{{- toYaml . | nindent 8 }}
138+
{{- end }}
135139
{{- with .Values.indexGateway.tolerations }}
136140
tolerations:
137141
{{- toYaml . | nindent 8 }}

‎production/helm/loki/templates/ingester/statefulset-ingester-zone-a.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ spec:
6969
{{- toYaml . | nindent 8 }}
7070
{{- end }}
7171
spec:
72-
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
72+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
7373
{{- with .Values.ingester.topologySpreadConstraints }}
7474
topologySpreadConstraints:
7575
{{- toYaml . | nindent 8 }}

‎production/helm/loki/templates/ingester/statefulset-ingester-zone-b.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ spec:
6969
{{- toYaml . | nindent 8 }}
7070
{{- end }}
7171
spec:
72-
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
72+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
7373
{{- with .Values.ingester.topologySpreadConstraints }}
7474
topologySpreadConstraints:
7575
{{- toYaml . | nindent 8 }}

‎production/helm/loki/templates/ingester/statefulset-ingester-zone-c.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ spec:
6969
{{- toYaml . | nindent 8 }}
7070
{{- end }}
7171
spec:
72-
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
72+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
7373
{{- with .Values.ingester.topologySpreadConstraints }}
7474
topologySpreadConstraints:
7575
{{- toYaml . | nindent 8 }}

‎production/helm/loki/templates/ingester/statefulset-ingester.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ spec:
5555
{{- toYaml . | nindent 8 }}
5656
{{- end }}
5757
spec:
58-
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
58+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
5959
{{- with .Values.ingester.topologySpreadConstraints }}
6060
topologySpreadConstraints:
6161
{{- toYaml . | nindent 8 }}

0 commit comments

Comments
 (0)