• Solly Ross's avatar
    HPA: Consider unready pods and missing metrics · 2c66d477
    Solly Ross authored
    Currently, the HPA considers unready pods the same as ready pods when
    looking at their CPU and custom metric usage.  However, pods frequently
    use extra CPU during initialization, so we want to consider them
    separately.
    
    This commit causes the HPA to consider unready pods as having 0 CPU
    usage when scaling up, and ignores them when scaling down.  If, when
    scaling up, factoring the unready pods as having 0 CPU would cause a
    downscale instead, we simply choose not to scale.  Otherwise, we simply
    scale up at the reduced amount caculated by factoring the pods in at
    zero CPU usage.
    
    The effect is that unready pods cause the autoscaler to be a bit more
    conservative -- large increases in CPU usage can still cause scales,
    even with unready pods in the mix, but will not cause the scale factors
    to be as large, in anticipation of the new pods later becoming ready and
    handling load.
    
    Similarly, if there are pods for which no metrics have been retrieved,
    these pods are treated as having 100% of the requested metric when
    scaling down, and 0% when scaling up.  As above, this cannot change the
    direction of the scale.
    
    This commit also changes the HPA to ignore superfluous metrics -- as
    long as metrics for all ready pods are present, the HPA we make scaling
    decisions.  Currently, this only works for CPU.  For custom metrics, we
    cannot identify which metrics go to which pods if we get superfluous
    metrics, so we abort the scale.
    2c66d477
Name
Last commit
Last update
..
certificates Loading commit data...
cronjob Loading commit data...
daemon Loading commit data...
deployment Loading commit data...
disruption Loading commit data...
endpoint Loading commit data...
garbagecollector Loading commit data...
informers Loading commit data...
job Loading commit data...
namespace Loading commit data...
node Loading commit data...
petset Loading commit data...
podautoscaler Loading commit data...
podgc Loading commit data...
replicaset Loading commit data...
replication Loading commit data...
resourcequota Loading commit data...
route Loading commit data...
service Loading commit data...
serviceaccount Loading commit data...
volume Loading commit data...
.import-restrictions Loading commit data...
BUILD Loading commit data...
OWNERS Loading commit data...
client_builder.go Loading commit data...
controller_ref_manager.go Loading commit data...
controller_utils.go Loading commit data...
controller_utils_test.go Loading commit data...
doc.go Loading commit data...
lookup_cache.go Loading commit data...