Auto-scaling for UserAssignments #2765
Draft
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Auto-scaling for UserAssignments
Overview
Implements automatic scaling of UserAssignments based on allocation demand. When utilization exceeds a configurable threshold, the system automatically increases ResourceClaim capacity to provide more available UserAssignments.
Problem Statement
Workshops with high user demand can run out of available UserAssignments, requiring manual intervention to increase ResourceClaim counts. This creates delays and requires constant monitoring of workshop utilization.
Solution
Auto-scaling monitors UserAssignment allocation rates and automatically scales WorkshopProvisions when demand is high:
assigned_users / total_users >= threshold(default: 80%)countbyscaleFactor(default: 1.5x)autoScalingActivestatus flagKey Features
autoScalingActiveflag prevents concurrent scaling operationsmaxProvisionsprevents runaway scalingConfiguration
Race Condition Prevention
The implementation prevents race conditions that could occur during ResourceClaim provisioning:
Testing
To test auto-scaling:
Deployment Requirements
The Workshop and WorkshopProvision CRDs must be updated with new schema before deploying this code.