Skip to content

enhancement: implemented anti-affinity for pods within same livestore…#6757

Merged
zhxiaogg merged 1 commit intografana:mainfrom
zhxiaogg:implement-anti-affinity-for-livestore
Mar 24, 2026
Merged

enhancement: implemented anti-affinity for pods within same livestore…#6757
zhxiaogg merged 1 commit intografana:mainfrom
zhxiaogg:implement-anti-affinity-for-livestore

Conversation

@zhxiaogg
Copy link
Copy Markdown
Contributor

@zhxiaogg zhxiaogg commented Mar 20, 2026

… zone

What this PR does:

  • try allocate pods from the same livestore zone sts on different nodes in the cluster

Which issue(s) this PR fixes:
Fixes N/A

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

Copilot AI review requested due to automatic review settings March 20, 2026 17:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a soft pod anti-affinity rule for Live Store zone StatefulSets to encourage spreading replicas from the same zone across distinct nodes (while preserving the existing hard anti-affinity behavior between zones).

Changes:

  • Introduces liveStoreZoneSoftAntiAffinity using preferredDuringSchedulingIgnoredDuringExecution with topologyKey: kubernetes.io/hostname.
  • Applies the new soft anti-affinity alongside the existing zone anti-affinity when generating zone StatefulSets.
  • Updates generated/compiled StatefulSet manifests for zone-a and zone-b (with and without extras) to include the new preference.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
operations/jsonnet/microservices/live-store.libsonnet Adds and wires a soft pod anti-affinity helper for same-zone Live Store pods.
operations/jsonnet-compiled/microservices/gen/StatefulSet-live-store-zone-a.yaml Generated manifest updated to include preferred pod anti-affinity for zone-a.
operations/jsonnet-compiled/microservices/gen/StatefulSet-live-store-zone-b.yaml Generated manifest updated to include preferred pod anti-affinity for zone-b.
operations/jsonnet-compiled/microservices-with-extras/gen/StatefulSet-live-store-zone-a.yaml Generated manifest updated to include preferred pod anti-affinity for zone-a (extras).
operations/jsonnet-compiled/microservices-with-extras/gen/StatefulSet-live-store-zone-b.yaml Generated manifest updated to include preferred pod anti-affinity for zone-b (extras).

Comment thread operations/jsonnet/microservices/live-store.libsonnet Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Comment thread operations/jsonnet/microservices/live-store.libsonnet Outdated
Comment thread CHANGELOG.md Outdated
@zhxiaogg zhxiaogg force-pushed the implement-anti-affinity-for-livestore branch from a69242f to 40be08a Compare March 20, 2026 17:52
@zhxiaogg zhxiaogg enabled auto-merge (squash) March 20, 2026 18:54
@zhxiaogg zhxiaogg merged commit d8b09c4 into grafana:main Mar 24, 2026
42 of 43 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants