Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Helm: Allow topologySpreadConstraints #11086

Merged

Conversation

kandrew5
Copy link
Contributor

@kandrew5 kandrew5 commented Oct 30, 2023

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

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • 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
  • 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
  • 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

@kandrew5 kandrew5 requested a review from a team as a code owner October 30, 2023 17:20
@CLAassistant
Copy link

CLAassistant commented Oct 30, 2023

CLA assistant check
All committers have signed the CLA.

@github-actions github-actions bot added area/helm type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories labels Oct 30, 2023
@kandrew5 kandrew5 changed the title Helm:allow topologySpreadConstraints Helm: allow topologySpreadConstraints Oct 30, 2023
@kandrew5 kandrew5 changed the title Helm: allow topologySpreadConstraints Helm: Allow topologySpreadConstraints Oct 30, 2023
@kandrew5
Copy link
Contributor Author

How do I run helm-docs?

@j4rj4r
Copy link
Contributor

j4rj4r commented Oct 31, 2023

How do I run helm-docs?

Install helm-docs binary and run it in the chart directory (loki/production/helm/loki).

@MichelHollands
Copy link
Contributor

@kandrew5 You also need to update the production/helm/loki/CHANGELOG.md and production/helm/loki/README.md as in the Example PR. Once that is done I'll merge.

@kandrew5
Copy link
Contributor Author

@MichelHollands Done!

@kandrew5
Copy link
Contributor Author

@trevorwhitney why does the helm-ci fail? Seems to be unrelated to my changes

@MichelHollands
Copy link
Contributor

@kandrew5 Can you merge in main? The CI had to be changed due to a dependency that no longer installs: see #11101 for details.

@MichelHollands
Copy link
Contributor

@kandrew5 Can you merge in main? The CI had to be changed due to a dependency that no longer installs: see #11101 for details.

UPDATE: I did this myself. Looking into another issue now.

@kandrew5
Copy link
Contributor Author

kandrew5 commented Nov 1, 2023

@MichelHollands one more error in the Linting CI job:

Linting chart with values file "production/helm/loki/ci/default-values.yaml"...
Error: unknown flag: --timeout

Copy link
Contributor

@MichelHollands MichelHollands left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@MichelHollands MichelHollands merged commit 303e353 into grafana:main Nov 1, 2023
8 checks passed
@kandrew5 kandrew5 deleted the feature/topology-spread-constraints branch November 1, 2023 11:22
@MichelHollands
Copy link
Contributor

@MichelHollands one more error in the Linting CI job:

Linting chart with values file "production/helm/loki/ci/default-values.yaml"...
Error: unknown flag: --timeout

@kandrew5 Yes, this was the other issue I was looking into. It's fixed and merged now. Sorry for the delay.

MichelHollands added a commit that referenced this pull request Dec 12, 2023
…11434)

**What this PR does / why we need it**:

Add missing topologySpreadConstraints for the read deployment component.
Must have been missed in this
[PR](#11086)

Helm diff:

```console
helm diff upgrade loki ./loki -f ~/values-test.yaml -n logging --allow-unreleased
logging, loki-read, Deployment (apps) has changed:
  # Source: loki/templates/read/deployment-read.yaml
  apiVersion: apps/v1
  kind: Deployment
  .......
+       topologySpreadConstraints:
+         - labelSelector:
+             matchLabels:
+               app.kubernetes.io/component: read
+               app.kubernetes.io/instance: loki
+               app.kubernetes.io/name: loki
+           maxSkew: 1
+           nodeAffinityPolicy: Honor
+           nodeTaintsPolicy: Honor
+           topologyKey: topology.kubernetes.io/zone
+           whenUnsatisfiable: ScheduleAnyway
```

**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)
- [ ] 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>
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
**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 grafana#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](grafana@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](grafana@0d4416a)

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
rhnasc pushed a commit to inloco/loki that referenced this pull request Apr 12, 2024
…rafana#11434)

**What this PR does / why we need it**:

Add missing topologySpreadConstraints for the read deployment component.
Must have been missed in this
[PR](grafana#11086)

Helm diff:

```console
helm diff upgrade loki ./loki -f ~/values-test.yaml -n logging --allow-unreleased
logging, loki-read, Deployment (apps) has changed:
  # Source: loki/templates/read/deployment-read.yaml
  apiVersion: apps/v1
  kind: Deployment
  .......
+       topologySpreadConstraints:
+         - labelSelector:
+             matchLabels:
+               app.kubernetes.io/component: read
+               app.kubernetes.io/instance: loki
+               app.kubernetes.io/name: loki
+           maxSkew: 1
+           nodeAffinityPolicy: Honor
+           nodeTaintsPolicy: Honor
+           topologyKey: topology.kubernetes.io/zone
+           whenUnsatisfiable: ScheduleAnyway
```

**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](grafana@d10549e)
- [ ] 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](grafana@0d4416a)

---------

Co-authored-by: Michel Hollands <42814411+MichelHollands@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/helm size/M type/docs Issues related to technical documentation; the Docs Squad uses this label across many repositories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Loki Helm Chart: Allow templating of Topology Spread Constraints
4 participants