Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Pending' instead of 'Running' causes wrong status check.
✗ Incorrect
The Pod phase 'Running' means the Pod is active and containers are running.
2fill in blank
mediumComplete 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Running' will list active Pods, not pending ones.
✗ Incorrect
The field-selector filters Pods by their phase. 'Pending' shows Pods waiting to start.
3fill in blank
hardFix 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'state' or 'condition' causes no output or errors.
✗ Incorrect
The correct JSON path key for Pod lifecycle state is 'phase'.
4fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using Pending or Failed will not show desired Pod states.
✗ Incorrect
This command filters Pods that are either Running or have Succeeded.
5fill in blank
hardFill 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'
Attempts:
3 left
💡 Hint
Common Mistakes
Using false for --watch disables live updates.
✗ Incorrect
This command watches Pods labeled 'frontend' as they enter the Running phase.