Kubernetes YAML Cheat Sheet/Server-side dry run

Validate a manifest against the API server without persisting it.

Section: YAML Validation and Troubleshooting

Server-side dry run

bash
bash
kubectl apply --dry-run=server -f deployment.yaml -o yaml
Explanation

Great for CI and schema validation when the cluster has the CRDs and admission rules you care about.

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
Explain a field path
Discover valid YAML fields from kubectl.
OpenIn sheetbashsame section
Show last-applied configuration
Inspect the apply annotation on a live resource.
OpenIn sheetbashsame section
Minimal Pod manifest
Smallest practical Pod YAML shape.
Labels and annotations example
Common metadata block for selectors and tooling.
Override container command and args
Set entrypoint-style command in YAML.
Basic Deployment YAML
Run a replicated stateless workload.