0
0
Kubernetesdevops~5 mins

CPU requests and limits in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a CPU request in Kubernetes?
A CPU request is the amount of CPU guaranteed to a container. Kubernetes uses this to decide which node can run the container.
Click to reveal answer
beginner
What happens if a container exceeds its CPU limit in Kubernetes?
If a container uses more CPU than its limit, Kubernetes throttles it to prevent it from using more CPU than allowed.
Click to reveal answer
intermediate
Why should you set both CPU requests and limits?
Setting both ensures your container gets enough CPU to run well (requests) and prevents it from using too much CPU (limits), helping cluster stability.
Click to reveal answer
intermediate
How does Kubernetes use CPU requests during scheduling?
Kubernetes sums CPU requests of all containers on a node and only schedules new containers if the node has enough free CPU to meet the request.
Click to reveal answer
beginner
What unit is used to specify CPU requests and limits in Kubernetes?
CPU is specified in cores or millicores (m). For example, 500m means half a CPU core.
Click to reveal answer
What does a CPU limit do in Kubernetes?
APrevents a container from using more CPU than the limit by throttling it
BGuarantees the container will always get this CPU amount
CSets the maximum memory a container can use
DSchedules the container on the node with the most CPU
What unit is used to specify CPU requests in Kubernetes?
ABytes
BCores or millicores (m)
CMilliseconds
DPercentage
If a container has a CPU request of 200m and a limit of 500m, what does this mean?
AIt is guaranteed 200m CPU and can use up to 500m CPU
BIt can only use 200m CPU and no more
CIt must use exactly 500m CPU
DIt has no CPU guarantees
What happens if you set a CPU limit but no CPU request?
AThe container is guaranteed CPU equal to the limit
BThe container can use unlimited CPU
CThe container has no guaranteed CPU but cannot exceed the limit
DThe container will not start
Why is it important to set CPU requests in Kubernetes?
ATo speed up container startup
BTo limit the container's CPU usage
CTo increase container memory
DTo help Kubernetes schedule containers on nodes with enough CPU
Explain the difference between CPU requests and CPU limits in Kubernetes.
Think about what Kubernetes guarantees versus what it restricts.
You got /4 concepts.
    Describe why setting CPU requests and limits helps maintain cluster stability.
    Consider how resources are shared in a busy kitchen.
    You got /4 concepts.