Command

Kubernetes Get a Pod's YAML Command

The Kubernetes command to get a pod's yaml is kubectl get pod my-pod -o yaml.

Quick Answer

Command
kubectl get pod my-pod -o yaml
KubernetesCommand

Get a Pod's YAML

Type this command
kubectl get pod my-pod -o yaml

Prints the full YAML of one pod.

Learn More

How to get a pod's yaml in Kubernetes

  1. Open the terminal or command interface for Kubernetes.
  2. Type kubectl get pod my-pod -o yaml, replace any placeholders, and run it.

Kubernetes Get a Pod's YAML Command

Run kubectl get pod my-pod -o yaml.

Related Commands

Frequently asked questions

What is the Kubernetes command to get a pod's yaml?

Run kubectl get pod my-pod -o yaml.

Where do I type this Kubernetes command?

Type it in the terminal or command-line interface used by Kubernetes.

Does this Kubernetes command work on Mac and Windows?

Yes. The command text is the same on both platforms when the tool is installed.

Official source · How we verify