get and describe

kubectl get, describe and Output Formatting

kubectl 5,150 get prints a table, but -o reshapes it: wide adds columns such as node and IP, yaml and json give the whole object including status, name prints kind/name lines for xargs, and jsonpath and custom-columns pick fields. Selection flags narrow the rows: -l by label, --field-selector by a few indexed fields such as spec.nodeName, -A across namespaces, --sort-by to order them:

Selecting, reshaping and sorting kubectl get outputShell
kubectl get pods -A --field-selector spec.nodeName=l3-booknest-worker -o name
kubectl get pods -n kube-system -l k8s-app=kube-dns \
  -o custom-columns=POD:.metadata.name,NODE:.spec.nodeName,IP:.status.podIP
kubectl get nodes --sort-by=.metadata.name \
  -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.allocatable.memory}{"\n"}{end}'
kubectl describe node l3-booknest-worker | grep -A5 'Allocated resources'
Output
pod/kindnet-7hl2m
pod/kube-proxy-vlf8z
POD                        NODE                        IP
coredns-559f6c778d-lw9cw   l3-booknest-control-plane   10.244.0.2
coredns-559f6c778d-qbf2r   l3-booknest-control-plane   10.244.0.4
l3-booknest-control-plane 32799328Ki
l3-booknest-worker 32799328Ki
Allocated resources:
  (Total limits may be over 100 percent, i.e., overcommitted.)
  Resource           Requests   Limits
  --------           --------   ------
  cpu                100m (2%)  0 (0%)
  memory             50Mi (0%)  0 (0%)

describe is the human view: it joins related information, such as the Pods on a node and their requests, and ends with recent events, where a failed pull or probe shows up first. -w streams changes (Watches and Informers). In scripts, use -o jsonpath or -o json | jq 133,477 , never the table, whose columns change between versions.