0
0
Kubernetesdevops~5 mins

OOMKilled containers in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the term OOMKilled mean in Kubernetes?
OOMKilled means a container was stopped because it used more memory than allowed, and the system killed it to protect other processes.
Click to reveal answer
beginner
How can you check if a container was OOMKilled?
Use the command kubectl describe pod <pod-name> and look for Last State: Terminated with reason OOMKilled.
Click to reveal answer
beginner
What Kubernetes resource controls the memory limit for a container?
The resources.limits.memory field in the container spec sets the maximum memory a container can use.
Click to reveal answer
beginner
Why is setting memory limits important in Kubernetes?
Memory limits prevent one container from using too much memory and crashing other containers or the node.
Click to reveal answer
beginner
What is a simple way to fix an OOMKilled container?
Increase the memory limit in the pod spec or optimize the application to use less memory.
Click to reveal answer
What does OOMKilled indicate in a Kubernetes container?
AThe container completed its task successfully
BThe container was restarted manually
CThe container was deleted by the user
DThe container was killed because it used too much memory
Which command helps you find if a pod was OOMKilled?
Akubectl describe pod &lt;pod-name&gt;
Bkubectl get nodes
Ckubectl logs &lt;pod-name&gt;
Dkubectl get services
What field sets the memory limit for a container in Kubernetes?
Aresources.limits.memory
Bspec.containers.image
Cmetadata.name
Dspec.replicas
If a container is OOMKilled, what is a common fix?
AChange the container image
BIncrease memory limits or optimize memory use
CReduce CPU limits
DDelete the pod immediately
Why does Kubernetes kill containers that exceed memory limits?
ATo save disk space
BTo restart the container automatically
CTo protect other containers and the node from crashing
DTo update the container image
Explain what causes a container to be OOMKilled in Kubernetes and how you can detect it.
Think about memory limits and pod status details.
You got /3 concepts.
    Describe two ways to prevent OOMKilled errors in Kubernetes containers.
    One is configuration, the other is code or app behavior.
    You got /2 concepts.