0
0
Kubernetesdevops~10 mins

Pod lifecycle states in Kubernetes - Interactive Code Practice

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

Complete the code to check if a Pod is in the Running state.

Kubernetes
kubectl get pod my-pod -o jsonpath='{.status.phase}' | grep [1]
Drag options to blanks, or click blank then click option'
ARunning
BPending
CSucceeded
DFailed
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Pending' instead of 'Running' causes wrong status check.
2fill in blank
medium

Complete the command to list Pods that are in the Pending state.

Kubernetes
kubectl get pods --field-selector status.phase=[1]
Drag options to blanks, or click blank then click option'
ARunning
BFailed
CSucceeded
DPending
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Running' will list active Pods, not pending ones.
3fill in blank
hard

Fix the error in the command to get the Pod phase correctly.

Kubernetes
kubectl get pod my-pod -o jsonpath='{.status.[1]'
Drag options to blanks, or click blank then click option'
Aphase
Bcondition
Cstatus
Dstate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state' or 'condition' causes no output or errors.
4fill in blank
hard

Fill both blanks to create a command that lists Pods in Running or Succeeded states.

Kubernetes
kubectl get pods --field-selector='status.phase in ([1],[2])'
Drag options to blanks, or click blank then click option'
ARunning
BPending
CSucceeded
DFailed
Attempts:
3 left
💡 Hint
Common Mistakes
Using Pending or Failed will not show desired Pod states.
5fill in blank
hard

Fill all three blanks to create a command that watches Pods entering Running state with a label.

Kubernetes
kubectl get pods -l app=[1] --field-selector status.phase=[2] --watch=[3]
Drag options to blanks, or click blank then click option'
Afrontend
BRunning
Ctrue
Dfalse
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for --watch disables live updates.