0
0
Kubernetesdevops~5 mins

kubectl get for listing resources in Kubernetes - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
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.
Click to reveal answer
intermediate
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.
Click to reveal answer
beginner
What option shows detailed information about resources with kubectl get?
The -o wide option shows extra details like node name and IP addresses.
Click to reveal answer
beginner
How can you list resources of a specific type, for example, services?
Run kubectl get services to list all services in the current namespace.
Click to reveal answer
intermediate
What does kubectl get pods -o json do?
It outputs the list of pods in JSON format, useful for scripts or detailed inspection.
Click to reveal answer
Which command lists all pods in the current namespace?
Akubectl get pods
Bkubectl list pods
Ckubectl show pods
Dkubectl describe pods
How do you list all resources across all namespaces?
Akubectl get namespaces
Bkubectl get all --namespace=all
Ckubectl list all namespaces
Dkubectl get all --all-namespaces
What does the '-o wide' option do with 'kubectl get'?
AOutputs in JSON format
BFilters output to only running pods
CShows more detailed information
DDeletes the resource
Which command outputs pods in JSON format?
Akubectl get pods -o json
Bkubectl describe pods
Ckubectl get pods -o yaml
Dkubectl list pods -json
To list services in the current namespace, you use:
Akubectl get pods
Bkubectl get services
Ckubectl list services
Dkubectl describe services
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.