Wide And Name Output
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 34 of 45.
The -o flag changes what kubectl get prints. You met -o wide already: for Pods it adds the IP and the NODE, for Deployments the CONTAINERS, IMAGES and SELECTOR:
kubectl get pods -o wide
kubectl get deployments -o wide-o name prints just the resource names, one per line, in the type/name form that other commands accept:
kubectl get pods -o nameThat is handy for scripts, and for seeing at a glance what exists.
To drop the header line from any table, add --no-headers. Combined with -o wide it gives you plain rows you can feed to tools like grep.
Challenge
BeginnerStart a Pod named web from the nginx image, list the Pods with the wide format to see its IP and node, then list them with the name format.
Try it yourself
This lesson includes a short quiz. Start the lesson to answer it and track your progress.
All lessons in Introduction to Kubernetes
Practice on your own: Terminal playground