Cloud and Container Basics

In Kubernetes, which of the following correctly describes the resource requests and limits set for a container?

  1. ANodes are chosen using requests, a container whose memory exceeds its limit may be killed, and CPU is held to the limit
  2. BThe scheduler places Pods so that the sum of limits fits within a node's resources, and a container whose CPU usage exceeds its request is killed
  3. CRequests are the maximum a container can use, and when usage exceeds the request, the container is killed at once, whether for memory or CPU
Show answer and explanation

Answer: A. Nodes are chosen using requests, a container whose memory exceeds its limit may be killed, and CPU is held to the limit

Requests are the amount of resources a container wants reserved, and the scheduler chooses the node for a Pod so that the sum of the requests of the Pods on a node does not exceed the node's allocatable resources. Limits are the upper bound on usage. CPU can be shared over time, so when a container tries to exceed its CPU limit its use is held back (throttling), and processing slows down. Memory is hard to take back, so a container that tries to use more than its memory limit may be killed as out of memory (OOMKilled).

  • A. Correct. Placement uses requests, the cap is the limit, and exceeding it is handled differently for CPU and memory.
  • B. Placement decisions use requests, not limits. Also, heavy CPU use does not get a container killed; its use is held back.
  • C. Using more than the request is allowed; the cap is the limit. Exceeding the CPU limit leads to throttling, not to the container being killed.
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. 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?
  2. 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?
  3. 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?
  4. With serverless functions (FaaS), only the first call to a function that has not been called for a while sometimes responds hundreds of milliseconds to several seconds slower. Which of the following correctly explains this phenomenon?
  5. Cloud storage is used for three purposes: (1) attaching it to a virtual machine as a disk, creating a file system and storing database data files; (2) mounting it from several servers at the same time and using it as a shared directory; (3) reading and writing a large number of images by key (name) through an HTTP API and growing the capacity without deciding it in advance. Which of the following is the appropriate combination of storage types for (1) to (3)?