0
0
Kubernetesdevops~10 mins

OOMKilled containers in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the command to check pods that were OOMKilled.

Kubernetes
kubectl get pods --field-selector status.phase=Failed -o json | jq '.items[] | select(.status.containerStatuses[].state.terminated.reason == "[1]") | .metadata.name'
Drag options to blanks, or click blank then click option'
ACompleted
BCrashLoopBackOff
COOMKilled
DError
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'CrashLoopBackOff' instead of 'OOMKilled'.
Using 'Error' which is too generic.
2fill in blank
medium

Complete the YAML snippet to set memory limit to 256Mi for a container.

Kubernetes
resources:
  limits:
    memory: [1]
Drag options to blanks, or click blank then click option'
A256MB
B256Mi
C256mb
D256M
Attempts:
3 left
💡 Hint
Common Mistakes
Using '256MB' which is invalid in Kubernetes YAML.
Using lowercase units like 'mb'.
3fill in blank
hard

Fix the error in the command to describe a pod named 'webapp' in namespace 'prod'.

Kubernetes
kubectl describe pod [1] -n prod
Drag options to blanks, or click blank then click option'
Aprod
Bpod/webapp
C--webapp
Dwebapp
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'prod' as pod name.
Using '--webapp' which is invalid flag.
4fill in blank
hard

Fill both blanks to create a pod spec with memory request 128Mi and limit 256Mi.

Kubernetes
resources:
  requests:
    memory: [1]
  limits:
    memory: [2]
Drag options to blanks, or click blank then click option'
A128Mi
B256Mi
C512Mi
D64Mi
Attempts:
3 left
💡 Hint
Common Mistakes
Setting requests higher than limits.
Using invalid memory units.
5fill in blank
hard

Fill all three blanks to create a pod spec with container name 'app', memory request 100Mi, and limit 200Mi.

Kubernetes
containers:
- name: [1]
  resources:
    requests:
      memory: [2]
    limits:
      memory: [3]
Drag options to blanks, or click blank then click option'
Aapp
B100Mi
C200Mi
Dweb
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong container name.
Swapping request and limit values.