Recall & Review
beginner Click to reveal answer
What does the command
kubectl get pods do?It lists all the pods running in the current Kubernetes namespace, showing their names, statuses, and other basic info.
intermediate Click to reveal answer
How do you list all resources in all namespaces using
kubectl get?Use
kubectl get all --all-namespaces to see all resource types across every namespace.beginner Click to reveal answer
What option shows detailed information about resources with
kubectl get?The
-o wide option shows extra details like node name and IP addresses.beginner Click to reveal answer
How can you list resources of a specific type, for example, services?
Run
kubectl get services to list all services in the current namespace.intermediate Click to reveal answer
What does
kubectl get pods -o json do?It outputs the list of pods in JSON format, useful for scripts or detailed inspection.
Which command lists all pods in the current namespace?
✗ Incorrect
The correct command to list pods is 'kubectl get pods'.
How do you list all resources across all namespaces?
✗ Incorrect
Use 'kubectl get all --all-namespaces' to list all resources in every namespace.
What does the '-o wide' option do with 'kubectl get'?
✗ Incorrect
'-o wide' shows extra details like node and IP addresses.
Which command outputs pods in JSON format?
✗ Incorrect
'kubectl get pods -o json' outputs pods in JSON format.
To list services in the current namespace, you use:
✗ Incorrect
'kubectl get services' lists all services in the current namespace.
Explain how to use
kubectl get to list all pods with extra details.Think about the option that shows more info than the default.
You got /3 concepts.
Describe how to list all Kubernetes resources across all namespaces.
Use the flag that includes all namespaces.
You got /3 concepts.
