A. The container was killed because it used too much memory.
B. The container ran out of CPU resources.
C. The container was terminated due to a manual stop.
D. The container crashed due to a software error.
Solution
Step 1: Analyze the Reason field
The Reason is 'OOMKilled', which means the container was killed because it exceeded memory limits.
Step 2: Understand Exit Code 137
Exit code 137 means the process was killed by signal 9 (SIGKILL), typical for OOMKilled events.
Final Answer:
The container was killed because it used too much memory. -> Option A
Quick Check:
Reason OOMKilled + Exit 137 = Memory kill [OK]
Hint: Exit code 137 with OOMKilled means memory limit exceeded [OK]
Common Mistakes:
Confusing CPU limits with memory limits
Assuming manual stop without checking reason
Thinking software error caused termination
4. You see a pod's container repeatedly OOMKilled. Which change fixes this issue?
medium
A. Increase the container's memory limit in the pod spec.
B. Decrease the container's CPU limit in the pod spec.
C. Remove the memory limit from the pod spec.
D. Restart the pod manually every time it OOMKills.
Solution
Step 1: Identify cause of repeated OOMKilled
Repeated OOMKilled means the container needs more memory than allowed.
Step 2: Choose proper fix
Increasing the memory limit lets the container use more memory and prevents OOMKilled.
Final Answer:
Increase the container's memory limit in the pod spec. -> Option A
Quick Check:
More memory limit stops OOMKilled [OK]
Hint: Raise memory limit to stop OOMKilled repeats [OK]
Common Mistakes:
Lowering CPU limit which doesn't affect memory
Removing memory limit causing instability
Relying on manual restarts instead of fixing limits
5. A pod's container is OOMKilled even though its memory limit is set to 512Mi. You want to prevent this without increasing the limit. What is the best approach?
hard
A. Increase the CPU limit to speed up processing.
B. Optimize the application to use less memory inside the container.
C. Remove the memory limit to avoid OOMKilled.
D. Add more replicas of the pod to distribute load.
Solution
Step 1: Understand memory limit and OOMKilled
The container hits the 512Mi limit and is killed. Increasing limit is not an option.
Step 2: Find alternative to increasing memory
Optimizing the app to use less memory reduces usage below the limit, preventing OOMKilled.
Step 3: Evaluate other options
Removing limit risks node stability, increasing CPU doesn't reduce memory, adding replicas doesn't fix memory per container.
Final Answer:
Optimize the application to use less memory inside the container. -> Option B
Quick Check:
Lower memory use avoids OOMKilled without raising limit [OK]
Hint: Reduce app memory use to avoid OOMKilled without raising limit [OK]