I have used following command for autoscaling.
kubectl autoscale deployment catch-node --cpu-percent=50 --min=1 --max=10
The status of autoscaling in my case on load test is as like below .
27th minute
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS AGE
catch-node Deployment/catch-node/scale 50% 20% 1 10 27m
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
catch-node 1 1 1 1 27m
29th minute
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS AGE
catch-node Deployment/catch-node/scale 50% 35% 1 10 29m
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
catch-node 1 1 1 1 29m
31st minute
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS AGE
catch-node Deployment/catch-node/scale 50% 55% 1 10 31m
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
catch-node 1 1 1 1 31m
34th minute
NAME REFERENCE TARGET CURRENT MINPODS MAXPODS AGE
catch-node Deployment/catch-node/scale 50% 190% 1 10 34m
NAME DESIRED CURRENT UP-TO-DATE AVAILABLE AGE
catch-node 4 4 4 4 34m
Here i am getting connection refusing error in the time between transition of 1 pod to 4pods on autoscaling. Please let me know how much time it will take to bring up new pods once it exceed the CPU % limit given during autoscale .Also please let me know is there any method to reduce this time .once all new pods comes up, the issue is not there . Thanks in advance
With those contents in a file called nginx. yaml , updating the autoscaler could be done via kubectl apply -f nginx. yaml . To delete just one of the deployments in a larger hpa config, run kubectl delete hpa <DEPLOYMENT NAME> .
When enabled, the cluster autoscaler algorithm checks for pending pods. The cluster autoscaler requests a newly provisioned node if: 1) there are pending pods due to not having enough available cluster resources to meet their requests and 2) the cluster or node pool has not reached the user-defined maximum node count.
As documented in this doc, there are two factors affect the reaction time of the autoscaler:
--horizontal-pod-autoscaler-sync-period
, which defines how often the autoscaler checks the status of the controlled resources. The default value is 30s. It can be changed via the flag of the controller-manager.
upscaleForbiddenWindow
, which defines how often the autoscaler can scale up the resource. The default value is 3 mins. Currently it's not adjustable.
According to the log you pasted, if the load is stable, the autoscaler should reacted in 30s after CPU usage reaches 55%, is that the case?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With