-
Epic
-
Resolution: Unresolved
-
Critical
-
None
-
None
-
None
-
None
-
NodePool API changes to support minimum replicas of 0
-
None
-
False
-
-
False
-
None
-
None
Epic Goal
Enable NodePool CRs to support setting minimum replicas to 0, allowing node pools to scale down completely when using autoscaling (scale-from-zero functionality).
Why is this important?
To support autoscaling from/to zero for Hypershift NodePools (OCPSTRAT-1525), the NodePool API must allow min-replicas=0 to be set alongside autoscaling configuration. This enables:
- Cost optimization by scaling down to zero nodes during off-hours or low-demand periods
- On-demand scaling that automatically provisions nodes when workloads require them
- Efficient resource management for development and testing environments
Implementation Details
The implementation includes the following changes (per PR #6975):
API Validation Changes
- Change NodePoolAutoScaling.Min validation from minimum=1 to minimum=0
- Update CRD manifests across all feature gates to allow min: 0
- Add min to the required fields list in CRD specifications
- Update API documentation to reflect 0 <= Min <= Max constraint
Controller Logic Updates
- Modify replica defaulting logic in hypershift-operator/controllers/nodepool/capi.go
- Change boundary checks from < Min to <= Min to properly handle Min=0
- Apply changes to both MachineDeployment and MachineSet replica management
RBAC Updates
- Add watch verb to cluster-autoscaler RBAC for infrastructure.cluster.x-k8s.io API group
- Allows informer to watch rather than poll for better performance
Scenarios
- Users configure a NodePool with autoscaling enabled and min: 0, max: N
- When no workloads are present, the node pool scales down to 0 nodes
- When workloads are scheduled, cluster-autoscaler scales up the node pool
- After workload removal, the node pool scales back down to 0 nodes
- API validation accepts this configuration without errors
Acceptance Criteria
- NodePool API accepts min: 0 configuration with autoscaling enabled
- API validation allows the combination of autoScaling.min: 0 and autoScaling.max: N
- NodePool controller properly handles zero-replica state
- Replica defaulting logic correctly processes min: 0
- RBAC permissions updated for cluster-autoscaler
- CI tests pass with the new functionality
Dependencies (internal and external)
- PR #6975: https://github.com/openshift/hypershift/pull/6975 (implementation PR)
- CNTRLPLANE-1479: Cluster API AWS provider scale from zero support (required for AWS)
- OCPSTRAT-1525: Parent feature for autoscaling from/to zero on HyperShift
- Cluster API: Opt-in Autoscaling from Zero proposal support
- Kubernetes Cluster Autoscaler: Must support scale-from-zero with provider metadata
Done Checklist
- CI - CI is running, tests are automated and merged
- Release Enablement - Release enablement details provided
- DEV - Upstream code and tests merged (PR #6975)
- DEV - Upstream documentation merged
- DEV - Downstream build attached to advisory
- QE - Test plans in Polarion
- QE - Automated tests merged (E2E test included in PR #6975)
- DOC - Downstream documentation merged
- relates to
-
CNTRLPLANE-1479 update cluster api aws provider with scale from zero information
-
- In Progress
-
-
OCPSTRAT-1525 Enable autoscaler from/to zero on Hypershift
-
- In Progress
-
- links to