Skip to content

Commit

Permalink
Helm: Allow topologySpreadConstraints (#11086)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
Allow topologySpreadConstraints for read, write, backend and gateway
statefulsets/deployments.

**Which issue(s) this PR fixes**:
Fixes #11081 

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [x] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [x] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)
- [x] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory.
[Example
PR](0d4416a)

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
  • Loading branch information
kandrew5 and MichelHollands committed Nov 1, 2023
1 parent 33b7e51 commit 303e353
Show file tree
Hide file tree
Showing 10 changed files with 68 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@

##### Enhancements

* [11086](https://github.com/grafana/loki/pull/11086) **kandrew5**: Helm: Allow topologySpreadConstraints
* [11003](https://github.com/grafana/loki/pull/11003) **MichelHollands**: Add the `metrics-namespace` flag to change the namespace of metrics currently using cortex as namespace.
* [10096](https://github.com/grafana/loki/pull/10096) **aschleck**: Storage: Allow setting a constant prefix for all created keys
* [11038](https://github.com/grafana/loki/pull/11038) **kavirajk**: Remove already deprecated `store.max-look-back-period`.
Expand Down
36 changes: 36 additions & 0 deletions docs/sources/setup/install/helm/reference.md
Expand Up @@ -366,6 +366,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>backend.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for backend pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -1445,6 +1454,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>gateway.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for gateway pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -3448,6 +3466,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>read.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for read pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -4748,6 +4775,15 @@ null
<td><pre lang="json">
[]
</pre>
</td>
</tr>
<tr>
<td>write.topologySpreadConstraints</td>
<td>list</td>
<td>Topology Spread Constraints for write pods</td>
<td><pre lang="json">
[]
</pre>
</td>
</tr>
</tbody>
Expand Down
5 changes: 5 additions & 0 deletions production/helm/loki/CHANGELOG.md
Expand Up @@ -13,6 +13,11 @@ 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.)

## 5.36.1

- [FEATURE] Allow topology spread constraints for Loki


## 5.36.0

- [CHANGE] Changed version of Loki to 2.9.2
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/Chart.yaml
Expand Up @@ -3,7 +3,7 @@ name: loki
description: Helm chart for Grafana Loki in simple, scalable mode
type: application
appVersion: 2.9.2
version: 5.36.0
version: 5.36.1
home: https://grafana.github.io/helm-charts
sources:
- https://github.com/grafana/loki
Expand Down
2 changes: 1 addition & 1 deletion production/helm/loki/README.md
@@ -1,6 +1,6 @@
# loki

![Version: 5.36.0](https://img.shields.io/badge/Version-5.36.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.2](https://img.shields.io/badge/AppVersion-2.9.2-informational?style=flat-square)
![Version: 5.36.1](https://img.shields.io/badge/Version-5.36.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.9.2](https://img.shields.io/badge/AppVersion-2.9.2-informational?style=flat-square)

Helm chart for Grafana Loki in simple, scalable mode

Expand Down
Expand Up @@ -215,6 +215,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.backend.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
Expand Up @@ -108,6 +108,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.gateway.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.gateway.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/templates/read/statefulset-read.yaml
Expand Up @@ -131,6 +131,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.read.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.read.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
4 changes: 4 additions & 0 deletions production/helm/loki/templates/write/statefulset-write.yaml
Expand Up @@ -150,6 +150,10 @@ spec:
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.write.topologySpreadConstraints }}
topologySpreadConstraints:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.write.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
Expand Down
8 changes: 8 additions & 0 deletions production/helm/loki/values.yaml
Expand Up @@ -800,6 +800,8 @@ write:
dnsConfig: {}
# -- Node selector for write pods
nodeSelector: {}
# -- Topology Spread Constraints for write pods
topologySpreadConstraints: []
# -- Tolerations for write pods
tolerations: []
# -- The default is to deploy all pods in parallel.
Expand Down Expand Up @@ -976,6 +978,8 @@ read:
dnsConfig: {}
# -- Node selector for read pods
nodeSelector: {}
# -- Topology Spread Constraints for read pods
topologySpreadConstraints: []
# -- Tolerations for read pods
tolerations: []
# -- The default is to deploy all pods in parallel.
Expand Down Expand Up @@ -1077,6 +1081,8 @@ backend:
dnsConfig: {}
# -- Node selector for backend pods
nodeSelector: {}
# -- Topology Spread Constraints for backend pods
topologySpreadConstraints: []
# -- Tolerations for backend pods
tolerations: []
# -- The default is to deploy all pods in parallel.
Expand Down Expand Up @@ -1333,6 +1339,8 @@ gateway:
dnsConfig: {}
# -- Node selector for gateway pods
nodeSelector: {}
# -- Topology Spread Constraints for gateway pods
topologySpreadConstraints: []
# -- Tolerations for gateway pods
tolerations: []
# Gateway service configuration
Expand Down

0 comments on commit 303e353

Please sign in to comment.