Cloud and Container Basics

A Kubernetes HorizontalPodAutoscaler has a target CPU utilization of 70% and a range of 1 to 10 Pods. Currently the average CPU utilization of 5 Pods is 30%. When the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉ (⌈ ⌉ means rounding up), which of the following is the required number of Pods?

  1. A2
  2. B3
  3. C12
Show answer and explanation

Answer: B. 3

A HorizontalPodAutoscaler determines the number of Pods as required number = ⌈current number × current utilization ÷ target utilization⌉. 5 × 30 ÷ 70 = 2.14…, which rounds up to 3. The same formula reduces the number when load falls (scale-in), and the result is kept within the specified range (1 to 10). In practice, a tolerance band leaves the number unchanged when the utilization ratio is close to 1, and a waiting period observes the load for a while before scaling in, so the number of Pods does not change too often.

  • A. This rounds 2.14… down. With 2 Pods the utilization per Pod would be 30 × 5 ÷ 2 = 75%, above the 70% target, so the value is rounded up.
  • B. Correct. 5 × 30 ÷ 70 = 2.14…, rounded up to 3.
  • C. This swaps the target and current utilization (5 × 70 ÷ 30 = 11.7…, rounded up). The utilization is below the target, so the number of Pods goes down.
Practice this topic Back to topic

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Cloud and Container Basics questions

  1. In a Deployment whose Pod containers have the settings above, four Pods are running, each using 400m (0.4 cores) of CPU. The HorizontalPodAutoscaler's target CPU utilization is 60%, and the required number of Pods is computed as ⌈current number × current utilization ÷ target utilization⌉. Which of the following is the required number of Pods?
  2. In Kubernetes, which of the following correctly describes the resource requests and limits set for a container?
  3. A node has allocatable resources of 4 CPU cores and 8 GiB of memory. Each Pod's container has requests of 500m CPU and 1.5 GiB memory and limits of 1 CPU core and 2 GiB memory. There are no other Pods and no system reservations. Which of the following is the maximum number of Pods that can be placed on this node?
  4. A managed database service in the cloud (one in which the provider operates the database software) is used. Under the shared responsibility model, which of the following generally remains the user's responsibility?
  5. In the cloud, which of the following is the main purpose of placing web servers and database replicas across several availability zones within the same region?