Skip to content

Spread HA noobaa-core replicas across nodes with preferred pod anti-affinity #2063

Description

@coderabbitai

Summary

Add default preferred pod anti-affinity for noobaa-core pods so the two Core HA replicas are preferentially scheduled onto different nodes.

Rationale

Core HA runs a leader and standby pod. Without an anti-affinity rule, both pods may be scheduled on the same node, leaving the deployment vulnerable to a single-node failure. The anti-affinity must remain preferred, rather than required, so single-node clusters and constrained environments remain schedulable.

Affected areas

  • deploy/internal/statefulset-core.yaml
  • Generated/embedded deployment bundle artifacts, if applicable
  • Reconciliation logic that composes the default pod affinity with any affinity provided through the NooBaa custom resource

Required changes

Add a preferred pod anti-affinity term to the core StatefulSet pod template:

  • Select pods labeled noobaa-core: noobaa.
  • Use a node-level topology key (for example, kubernetes.io/hostname) to prefer separate nodes.
  • Preserve compatibility with single-node clusters.
  • Ensure the default rule is applied together with, and does not unintentionally replace, CR-provided affinity.

Acceptance criteria

  • In a multi-node cluster, the scheduler prefers placing the two noobaa-core replicas on different nodes.
  • In a single-node cluster, both replicas can still be scheduled.
  • Existing CR-scoped affinity behavior remains functional.
  • Generated bundle artifacts are updated when required.

Backlinks

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions