Skip to content

feat(): add ActiveController to ClusterStatus for Active/Standby controller HA - #46

Open
sumanthd032 wants to merge 1 commit into
kubeslice:masterfrom
sumanthd032:feat/active-controller-status
Open

feat(): add ActiveController to ClusterStatus for Active/Standby controller HA#46
sumanthd032 wants to merge 1 commit into
kubeslice:masterfrom
sumanthd032:feat/active-controller-status

Conversation

@sumanthd032

@sumanthd032 sumanthd032 commented Jul 29, 2026

Copy link
Copy Markdown

Description

Adds ActiveController to ClusterStatus, carrying the endpoint, CA bundle, identity and last-updated timestamp of the hub controller that currently holds leadership.

This is the field a worker reads to find the Active hub after a failover, for the Active/Standby HA work (kubeslice-controller #293, #297 and worker-operator #467). It lives here because kubeslice-controller writes it and worker-operator reads it, and both consume this module.

Additive only, all fields omitempty, no existing field changed. Follows the shape of 83d1dac.

A tagged release after merge would help: worker-operator needs to bump this dependency before #467 can consume the field.

Fixes #45

How Has This Been Tested?

  • make generate with the repo's pinned controller-gen; the only generated additions are the deepcopy methods for the new type and the nil-guarded pointer copy in ClusterStatus.DeepCopyInto.
  • go build ./..., go vet ./..., gofmt -l pkg/ clean.
  • Not yet exercised end to end: the producer and consumer are both blocked on this type existing.

Checklist:

  • The title of the PR states what changed and the related issues number (used for the release note).
  • Does this PR requires documentation updates?
  • I've updated documentation as required by this PR.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have tested it for all user roles.
  • I have added all the required unit test cases.

Does this PR introduce a breaking change for other components like kubeslice-controller, worker-operator?

No, additive fields only.


…ller HA

Adds the API carrier for Active/Standby high availability of the KubeSlice
controller, where two hub clusters run the controller and worker clusters
must find the Active again after a failover with no manual reconfiguration.

- ClusterStatus.ActiveController (*ActiveControllerInfo)
- ActiveControllerInfo: Endpoint, CABundle, ActiveIdentity, LastUpdated

Each hub writes this field about itself, on its own API server, and only
while it holds leadership. A Standby's copy is populated by the state
mirror from the Active, so it names the Active rather than itself. That
lets a worker watching both hub endpoints identify the Active by the rule
"trust whichever endpoint is reachable and reports an ActiveIdentity
matching that endpoint's own identity", without needing to know which role
either hub currently holds, and without inferring a death from a timeout.

LastUpdated gives a consumer a deterministic tie-break if a partition
causes both hubs to self-declare at once; without a freshness signal on
the object itself a worker would have to read coordination.k8s.io Leases
across clusters to resolve it. StorageCapabilities.LastUpdated in this
same struct is existing precedent for the pattern.

Additive only, all fields omitempty, no existing field changed. A
deployment that never publishes the field leaves it nil, which is exactly
the non-HA case.

Fixes kubeslice#45

Signed-off-by: Sumanth D <sumanthd032@gmail.com>
Copilot AI review requested due to automatic review settings July 29, 2026 07:58

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

Feature: add ActiveController to ClusterStatus for Active/Standby controller HA

2 participants