mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-11-25 15:33:33 +00:00
Automatic merge from submit-queue (batch tested with PRs 48997, 48595, 48898, 48711, 48972) hpa: Prevent scaling below MinReplicas if desiredReplicas is zero **What this PR does / why we need it**: Prevent a HPA scaling below `minReplicas` if `desiredReplicas` is calculated as `0`. Example events of a HPA continuously scaling between `1` and `MinReplicas`: ``` 2h 59s 22 horizontal-pod-autoscaler Normal SuccessfulRescale New size: 1; reason: All metrics below target 2h 29s 22 horizontal-pod-autoscaler Normal SuccessfulRescale New size: 15; reason: Current number of replicas below Spec.MinReplicas ``` **Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #49028 **Special notes for your reviewer**: **Release note**: ```release-note hpa: Prevent scaling below MinReplicas if desiredReplicas is zero ```