Skip to content

Commit

Permalink
feat: expose topologySpreadConstraints for distributed deployment (#1…
Browse files Browse the repository at this point in the history
  • Loading branch information
mericks authored Nov 13, 2024
1 parent a8f7851 commit d075107
Showing 16 changed files with 136 additions and 12 deletions.
80 changes: 75 additions & 5 deletions docs/sources/setup/install/helm/reference.md
Original file line number Diff line number Diff line change
@@ -2695,7 +2695,8 @@ null
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 30,
"tolerations": []
"tolerations": [],
"topologySpreadConstraints": []
}
</pre>
</td>
@@ -3015,6 +3016,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>distributor.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for distributor pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -3658,6 +3668,7 @@ false
},
"terminationGracePeriodSeconds": 60,
"tolerations": [],
"topologySpreadConstraints": [],
"useDefaultProxyURLs": true
}
</pre>
@@ -3858,6 +3869,15 @@ false
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>enterpriseGateway.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for enterprise-gateway pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -4658,6 +4678,7 @@ null
"serviceLabels": {},
"terminationGracePeriodSeconds": 300,
"tolerations": [],
"topologySpreadConstraints": [],
"updateStrategy": {
"type": "RollingUpdate"
}
@@ -4944,6 +4965,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>indexGateway.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for index-gateway pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -7686,7 +7716,8 @@ false
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 30,
"tolerations": []
"tolerations": [],
"topologySpreadConstraints": []
}
</pre>
</td>
@@ -8015,6 +8046,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>patternIngester.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for pattern ingester pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -8541,7 +8581,8 @@ Defaults to allow skew no more then 1 node
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 30,
"tolerations": []
"tolerations": [],
"topologySpreadConstraints": []
}
</pre>
</td>
@@ -8852,6 +8893,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>queryFrontend.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for query-frontend pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -8899,7 +8949,8 @@ null
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 30,
"tolerations": []
"tolerations": [],
"topologySpreadConstraints": []
}
</pre>
</td>
@@ -9111,6 +9162,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>queryScheduler.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for query-scheduler pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
@@ -10008,7 +10068,8 @@ null
"serviceAnnotations": {},
"serviceLabels": {},
"terminationGracePeriodSeconds": 300,
"tolerations": []
"tolerations": [],
"topologySpreadConstraints": []
}
</pre>
</td>
@@ -10301,6 +10362,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>ruler.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for ruler pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
2 changes: 2 additions & 0 deletions production/helm/loki/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.)

- [ENHANCEMENT] Expose Topology Spread Constraints in Helm chart templates and default values.

## 6.19.0

## 6.18.0
Original file line number Diff line number Diff line change
@@ -48,7 +48,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.compactor.topologySpreadConstraints }}
topologySpreadConstraints:
{{- tpl . $ | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -44,6 +44,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.distributor.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "loki.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Original file line number Diff line number Diff line change
@@ -38,6 +38,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.enterpriseGateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ template "loki.serviceAccountName" . }}
{{- if .Values.enterpriseGateway.priorityClassName }}
priorityClassName: {{ .Values.enterpriseGateway.priorityClassName }}
@@ -143,4 +149,4 @@ spec:
{{- if .Values.enterpriseGateway.extraVolumes }}
{{ toYaml .Values.enterpriseGateway.extraVolumes | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -132,6 +132,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.indexGateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.indexGateway.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -69,7 +69,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -55,7 +55,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ingester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -131,6 +131,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.patternIngester.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.patternIngester.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion }}
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.querier.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
Original file line number Diff line number Diff line change
@@ -43,6 +43,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.queryFrontend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "loki.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
Original file line number Diff line number Diff line change
@@ -41,6 +41,12 @@ spec:
{{- end }}
app.kubernetes.io/part-of: memberlist
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.queryScheduler.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "loki.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
6 changes: 6 additions & 0 deletions production/helm/loki/templates/ruler/statefulset-ruler.yaml
Original file line number Diff line number Diff line change
@@ -38,6 +38,12 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.Version }}
{{- with .Values.ruler.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
serviceAccountName: {{ include "loki.serviceAccountName" . }}
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
14 changes: 14 additions & 0 deletions production/helm/loki/values.yaml
Original file line number Diff line number Diff line change
@@ -1161,6 +1161,8 @@ enterpriseGateway:
affinity: {}
# -- Node selector for gateway Pods
nodeSelector: {}
# -- Topology Spread Constraints for enterprise-gateway pods
topologySpreadConstraints: []
# -- Tolerations for gateway Pods
tolerations: []
# -- Grace period to allow the gateway to shutdown before it is killed
@@ -1973,6 +1975,8 @@ distributor:
maxSurge: 0
# -- Node selector for distributor pods
nodeSelector: {}
# -- Topology Spread Constraints for distributor pods
topologySpreadConstraints: []
# -- Tolerations for distributor pods
tolerations: []
# -- Adds the appProtocol field to the distributor service. This allows distributor to work with istio protocol selection.
@@ -2181,6 +2185,8 @@ queryFrontend:
maxUnavailable: null
# -- Node selector for query-frontend pods
nodeSelector: {}
# -- Topology Spread Constraints for query-frontend pods
topologySpreadConstraints: []
# -- Tolerations for query-frontend pods
tolerations: []
# -- Adds the appProtocol field to the queryFrontend service. This allows queryFrontend to work with istio protocol selection.
@@ -2244,6 +2250,8 @@ queryScheduler:
maxUnavailable: 1
# -- Node selector for query-scheduler pods
nodeSelector: {}
# -- Topology Spread Constraints for query-scheduler pods
topologySpreadConstraints: []
# -- Tolerations for query-scheduler pods
tolerations: []
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
@@ -2308,6 +2316,8 @@ indexGateway:
maxUnavailable: null
# -- Node selector for index-gateway pods
nodeSelector: {}
# -- Topology Spread Constraints for index-gateway pods
topologySpreadConstraints: []
# -- Tolerations for index-gateway pods
tolerations: []
persistence:
@@ -2796,6 +2806,8 @@ patternIngester:
terminationGracePeriodSeconds: 30
# -- Node selector for pattern ingester pods
nodeSelector: {}
# -- Topology Spread Constraints for pattern ingester pods
topologySpreadConstraints: []
# -- Tolerations for pattern ingester pods
tolerations: []
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
@@ -2904,6 +2916,8 @@ ruler:
maxUnavailable: null
# -- Node selector for ruler pods
nodeSelector: {}
# -- Topology Spread Constraints for ruler pods
topologySpreadConstraints: []
# -- Tolerations for ruler pods
tolerations: []
# -- DNSConfig for ruler pods

0 comments on commit d075107

Please sign in to comment.