YAML Output
Part of the Introduction to Kubernetes section of Coddy's Terminal journey. Lesson 35 of 45.
Tables show a summary. To see everything Kubernetes knows about an object, ask for it as YAML:
kubectl get pod web -o yamlThe output is a complete manifest: the metadata with labels and a unique uid, the full spec with the defaults Kubernetes filled in, and a status section you never write yourself.
The status is where the live facts are: phase: Running, the podIP, the node's hostIP and, under containerStatuses, the state and restart count of every container.
-o json gives the same object as JSON, which tools can parse. Both formats work for any resource: try kubectl get deployment web -o yaml or kubectl get service web -o json.
Challenge
BeginnerStart a Pod named web from the nginx image, then print it as YAML and find phase and podIP in its status.
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