mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-03 03:38:15 +00:00
Previously, when `GetObjectMetricReplicas` calculated the desired replica count, it multiplied the usage ratio by the current number of replicas. This method caused over-scaling when there were pods that were not ready for a long period of time. For example, if there were pods A, B, and C, and only pod A was ready, and the usage ratio was 500%, we would previously specify 15 pods as the desired replicas (even though really only one pod was handling the load). After this change, we now multiple the usage ratio by the number of ready pods for `GetObjectMetricReplicas`. In the example above, we'd only desire 5 replica pods. This change gives `GetObjectMetricReplicas` the same behavior as the other replica calculator methods. Only `GetExternalMetricReplicas` and `GetExternalPerPodMetricRepliacs` still allow unready pods to impact the number of desired replicas. I will fix this issue in the following commit.