Skip to content

Conversation

mvink-guida
Copy link

What this PR does / why we need it:
Allow balance singleBinary replicas when using 3 replicas and objectStorage over just two nodes or zones.
With topologySpreadConstraints you can accomplish affinity just over two topologyKeys and so allow cluster autoscaler to scale back to two nodes/zones, in our case zoneC(or the 3rd node) should stay optional as fallback. With podAntiAffinity you can not accomplish this.

singleBinary:
  affinity: null
  topologySpreadConstraints:
    - maxSkew: 2
      minDomains: 2
      topologyKey: topology.kubernetes.io/zone
      whenUnsatisfiable: DoNotSchedule
      labelSelector:
        matchLabels:
          app.kubernetes.io/component: single-binary
          app.kubernetes.io/instance: loki
          app.kubernetes.io/name: loki

Which issue(s) this PR fixes:
Fixes #10205

Special notes for your reviewer:

Checklist

  • Reviewed the CONTRIBUTING.md guide (required)
  • Documentation added
  • Tests updated
  • Title matches the required conventional commits format, see here
    • Note that Promtail is considered to be feature complete, and future development for logs collection will be in Grafana Alloy. As such, feat PRs are unlikely to be accepted unless a case can be made for the feature actually being a bug fix to existing behavior.
  • Changes that require user attention or interaction to upgrade are documented in docs/sources/setup/upgrade/_index.md
  • 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

@mvink-guida mvink-guida requested a review from a team as a code owner October 17, 2025 08:54
@CLAassistant
Copy link

CLAassistant commented Oct 17, 2025

CLA assistant check
All committers have signed the CLA.

@jkroepke
Copy link
Contributor

Hi, please run make helm-docs and add a CHANGELOG note

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Helm Chart - support topologySpreadConstraints

3 participants