Uploaded image for project: 'Red Hat OpenShift Control Planes'
  1. Red Hat OpenShift Control Planes
  2. CNTRLPLANE-1622

Add API support for setting min-replicas=0 on NodePool CRs

XMLWordPrintable

    • Icon: Epic Epic
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • None
    • None
    • None
    • NodePool API changes to support minimum replicas of 0
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • 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)

      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

              rhn-support-jjaggars Jesse Jaggars
              rhn-support-jjaggars Jesse Jaggars
              None
              None
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated: