-o: von wide bis go-template
-o wide|yaml|json|name für den Alltag.
kyaml (stable seit v1.37): strikte
YAML-Teilmenge, nicht whitespace-sensitiv, String-Werte immer
quotiert (kein no → false),
Maps und Listen in {}/[].
jsonpath: Feld-Extraktion mit
range/Filter, Script-Futter statt
grep-Kaskaden.
custom-columns: eigene Tabellen direkt aus dem
API-Objekt.
go-template: volle Template-Logik inkl.
base64decode für Secrets.
Sortieren & Filtern
--sort-by nimmt einen JSONPath.
-l filtert nach Labels
(app=web,tier!=cache),
--field-selector nach Objektfeldern
(status.phase=Running). -A = alle
Namespaces.
kubectl get pods -o jsonpath='{.items[*].spec.containers[*].image}'
kubectl get pods -o jsonpath='{range .items[*]}{.metadata.name} {.status.podIP}{"\n"}{end}'
cols='NAME:.metadata.name,TAINT:.spec.taints[*].key'
kubectl get nodes -o custom-columns="$cols"
kubectl get secret db -o go-template='{{index .data "ca.crt" | base64decode}}'
kubectl get pods -A --sort-by=.metadata.creationTimestamp
kubectl get deploy web -o kyaml