Complete the command to check pods that were OOMKilled.
kubectl get pods --field-selector status.phase=Failed -o json | jq '.items[] | select(.status.containerStatuses[].state.terminated.reason == "[1]") | .metadata.name'
The reason for containers killed due to out-of-memory is OOMKilled.
Complete the YAML snippet to set memory limit to 256Mi for a container.
resources:
limits:
memory: [1]In Kubernetes, memory limits use Mi (mebibytes) notation, so 256Mi is correct.
Fix the error in the command to describe a pod named 'webapp' in namespace 'prod'.
kubectl describe pod [1] -n prodThe pod name is passed directly without prefix or flags. So just webapp is correct.
Fill both blanks to create a pod spec with memory request 128Mi and limit 256Mi.
resources:
requests:
memory: [1]
limits:
memory: [2]Memory requests should be lower or equal to limits. Here, 128Mi request and 256Mi limit is correct.
Fill all three blanks to create a pod spec with container name 'app', memory request 100Mi, and limit 200Mi.
containers: - name: [1] resources: requests: memory: [2] limits: memory: [3]
The container name is 'app', with memory request 100Mi and limit 200Mi as per spec.