Welcome to the Linux Foundation Forum!

Horizontal Pod Autoscalers (HPA), what's the default CPU usage?

Hi,
in the content of the course LFS258 CKA in the chapter (06. API Objects) in the section Autoscaling it's being described the following:
"HPAs automatically scale Replication Controllers, ReplicaSets, or Deployments based on a target of 80% CPU usage by default."

Then in the quiz section, this question is asked:
"Which of the following scales resources based on CPU usage (50% by default)?"
The correct answer is "Horizontal Pod Autoscaling"

Which statement is the correct one? the one in the quiz or the one in the course?
I'm confused here.
Thanks a lot.

Best Answer

  • fazlur.khan
    fazlur.khan Posts: 59
    Answer ✓

    Hello @elamin,

    The default target CPU utilization is considered as 80%. This can be validated by creating and hpa and not specifying the CPU utilization target. The system will default to 80%.

    I will get the quiz section updated to reflect correct values. Thank you.

    student@cp:~$ kubectl create deploy foo --image nginx
    student@cp:~$ kubectl autoscale deployment foo --min=2 --max=10
    student@cp:~$ kubectl get hpa
    NAME REFERENCE TARGETS MINPODS MAXPODS REPLICAS AGE
    foo Deployment/foo cpu: /80% 2 10 2 4m17s

    Regards,
    Fazlur

Categories

Upcoming Training