Kubernetes YAML Cheat Sheet/Explain a field path

Discover valid YAML fields from kubectl.

Section: YAML Validation and Troubleshooting

Explain a field path

bash
bash
kubectl explain deployment.spec.template.spec.containers

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing YAML Validation and Troubleshooting
Server-side dry run
Validate a manifest against the API server without persisting it.
OpenIn sheetbashsame section
Show last-applied configuration
Inspect the apply annotation on a live resource.
OpenIn sheetbashsame section
Get resources by label selector
Use labels to query related objects.
OpenIn sheetbash1 tag match
Apply YAML file
Create or update resources from a YAML file.
OpenIn sheetbash1 tag match
Add or update label from CLI
Patch a label onto a resource.
OpenIn sheetbash1 tag match
Apply YAML directory
Apply all manifests in a directory.
OpenIn sheetbash1 tag match