Challenge - 5 Problems
Kubectl Get Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Output of kubectl get pods with label filter
What is the output of the command
kubectl get pods -l app=web if the cluster has three pods: web-1 (Running), web-2 (Pending), and db-1 (Running)?Kubernetes
kubectl get pods -l app=webAttempts:
2 left
💡 Hint
The label selector
-l app=web filters pods with label app=web only.✗ Incorrect
The command lists pods with label
app=web. Only web-1 and web-2 match. db-1 is excluded.🧠 Conceptual
intermediate1:30remaining
Understanding kubectl get resource types
Which resource type will
kubectl get svc list in a Kubernetes cluster?Attempts:
2 left
💡 Hint
The abbreviation
svc stands for a common Kubernetes resource that exposes an application.✗ Incorrect
svc is short for Services, which expose pods to network traffic.❓ Troubleshoot
advanced2:00remaining
Troubleshooting kubectl get with namespace option
You run
kubectl get pods --namespace=dev but get the error: error: the server doesn't have a resource type "pods". What is the most likely cause?Attempts:
2 left
💡 Hint
Check the command syntax and order of arguments.
✗ Incorrect
The error occurs because the resource type 'pods' is not specified before the namespace flag. The correct command is
kubectl get pods --namespace=dev or kubectl get pods -n dev.🔀 Workflow
advanced2:00remaining
Correct order to list all resources in all namespaces
Which command correctly lists all pods in all namespaces with wide output showing node names?
Attempts:
2 left
💡 Hint
Short flags can be combined and order matters for readability.
✗ Incorrect
Option A uses the short flag
-A for all namespaces and -o wide for detailed output. This is the most common and correct usage.✅ Best Practice
expert2:30remaining
Choosing the best kubectl get command for resource monitoring
You want to monitor the status of all deployments in the 'production' namespace, refreshing every 5 seconds. Which command is best?
Attempts:
2 left
💡 Hint
Check the official kubectl flags for watching resources.
✗ Incorrect
The
--watch flag enables live updates. The --interval flag sets the refresh rate in seconds. Option C uses correct flags and syntax.