feat: impl rollout coordination for roles in rbg#91
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR implements a coordination feature for managing rolling updates across multiple roles in a RoleBasedGroup, enabling synchronized rollout strategies with configurable constraints on replica update skew.
- Adds coordination API types to specify MaxSkew, Partition, and MaxUnavailable parameters
- Implements coordination calculation logic to determine rolling update targets while respecting skew constraints
- Extends role status tracking to include UpdatedReplicas field for coordination decisions
Reviewed Changes
Copilot reviewed 28 out of 28 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| api/workloads/v1alpha1/rolebasedgroup_types.go | Adds Coordination and CoordinationRolloutStrategy types with MaxSkew, Partition, and MaxUnavailable fields |
| internal/controller/workloads/rolebasedgroup_controller.go | Implements coordination calculation logic including CalculateCoordinationByRole and related helper functions |
| pkg/utils/utils.go | Moves CalculatePartitionReplicas from instanceset/utils for broader reuse |
| pkg/reconciler/*.go | Updates reconcilers to accept coordinationRollout parameter and apply coordination constraints |
| config/crd/bases/*.yaml | Updates CRD schemas to include coordination specifications and updatedReplicas in status |
| client-go/applyconfiguration/*.go | Adds generated apply configurations for coordination types |
Comments suppressed due to low confidence (3)
pkg/reconciler/sts_reconciler.go:225
- The log message says 'case 2' but the comment above says 'Case 3'. This inconsistency makes debugging difficult. Update the log message to 'case 3' to match the comment.
logger.V(1).Info(fmt.Sprintf("case 2: rolling update started. partition %d, replicas: %d", partition, replicas))
pkg/reconciler/sts_reconciler.go:256
- The log message says 'case 4' but the comment above says 'Case 5'. This inconsistency makes debugging difficult. Update the log message to 'case 5' to match the comment.
"case 4: Replicas changed during rolling update. partition %d, replicas: %d", partition, replicas,
pkg/reconciler/sts_reconciler.go:277
- The log message says 'case 5' but the comment above says 'Case 6'. This inconsistency makes debugging difficult. Update the log message to 'case 6' to match the comment.
"case 5: Calculating the Partition during rolling update. partition %d, replicas: %d", partition, replicas,
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
1fdb174 to
243a8ad
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
243a8ad to
b86d447
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 30 out of 31 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
b86d447 to
88b833c
Compare
88b833c to
cf56012
Compare
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 35 out of 36 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Signed-off-by: veophi <[email protected]>
cf56012 to
6f06a53
Compare
Ⅰ. Motivation
More details in KEP .
A RBG demo using coordination feature:
a normal rolling update case:

a decode publish exception case. Prefill will automatically pause the upgrade proportionally.

Ⅱ. Modifications
RBG API:
rbg.spec.coordinationfield is added.rbg.status.roleStatuses[x].updatedReplicasis added.rbg.spec.roles[x].minReadySecondsis added.RBG Controller:
Ⅲ. Does this pull request fix one issue?
fixes #45
Ⅳ. List the added test cases (unit test/integration test) if any, please explain if no tests are needed.
Ⅴ. Describe how to verify it
VI. Special notes for reviews
Checklist
make fmt.