Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kubernetes: how autoscaling initial readiness is specified?

Tags:

kubernetes

My deployment in Kubernetes takes a couple of minutes to initialize, and it has an increased CPU usage during that period. I need a way to wait and disregard CPU metrics from the initialization period for the horizontal autoscaling metrics.

There is a question which asks just that, and the answer mentions some relevant flags --horizontal-pod-autoscaler-initial-readiness-delay and --horizontal-pod-autoscaler-cpu-initialization-period. But, after reading the Kubernetes documentation and finding some Kubernetes' Github issue, I still don't quite understand the exact effect from the flags and how to apply them at all: kubectl autoscale doesn't seem to accept them in any form.

This 3rd-party documentation demonstrates how to specify these values in yaml but it uses some custom API version and their configuration doesn't work for autoscaling/v2beta2.

How these flags are supposed to be put to use?

like image 934
kazarey Avatar asked Oct 17 '25 11:10

kazarey


1 Answers

You need to set these flags in kube controller manager which is a control plane component of kubernetes

--horizontal-pod-autoscaler-initial-readiness-delay duration     Default: 30s
The period after pod start during which readiness changes will be treated as initial readiness.

--horizontal-pod-autoscaler-cpu-initialization-period duration     Default: 5m0s
The period after pod start when CPU samples might be skipped.

https://kubernetes.io/docs/reference/command-line-tools-reference/kube-controller-manager/

like image 87
Arghya Sadhu Avatar answered Oct 20 '25 16:10

Arghya Sadhu



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!