0
0
Kubernetesdevops~5 mins

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

Choose your learning style9 modes available
Recall & Review
beginner
What is a resource request in Kubernetes?
A resource request is the amount of CPU or memory that a container is guaranteed to have. Kubernetes uses this to decide which node can run the container.
Click to reveal answer
beginner
What happens if a container exceeds its resource limit in Kubernetes?
If a container uses more CPU than its limit, Kubernetes throttles it. If it uses more memory than its limit, the container may be terminated (killed).
Click to reveal answer
intermediate
Why should you set both resource requests and limits?
Setting requests ensures your container gets enough resources to run well. Limits prevent it from using too much and affecting other containers.
Click to reveal answer
intermediate
How does Kubernetes use resource requests during scheduling?
Kubernetes checks the resource requests of a pod and finds a node with enough free resources to meet those requests before placing the pod there.
Click to reveal answer
beginner
Give an example of setting CPU and memory requests and limits in a pod spec.
Example YAML snippet: resources: requests: memory: "128Mi" cpu: "250m" limits: memory: "256Mi" cpu: "500m"
Click to reveal answer
What does a CPU request specify in Kubernetes?
AThe CPU used by other containers
BThe maximum CPU the container can use
CThe total CPU of the node
DThe minimum CPU guaranteed for the container
What happens if a container exceeds its memory limit?
AIt is throttled
BIt is terminated (killed)
CIt continues running without limits
DIt is moved to another node
Why is it important to set resource limits?
ATo prevent a container from using too many resources
BTo speed up the container startup
CTo guarantee unlimited resources
DTo increase node capacity
Which Kubernetes component uses resource requests to schedule pods?
Akubelet
Bkube-proxy
Cscheduler
Dcontroller-manager
In the resources section, what unit is '500m' CPU?
A0.5 CPU (half a CPU)
B500 CPUs
C500 MHz CPU
D500 MB CPU
Explain the difference between resource requests and limits in Kubernetes.
Think about what Kubernetes guarantees versus what it restricts.
You got /4 concepts.
    Describe what happens when a container uses more CPU or memory than its limits.
    Consider how Kubernetes controls resource usage to keep the system stable.
    You got /3 concepts.