Kubernetes YAML Cheat Sheet/Apply YAML directory

Apply all manifests in a directory.

Section: Manifest Basics

Apply YAML directory

bash
bash
kubectl apply -f k8s/
Explanation

A common declarative workflow is to keep configuration files in a directory and apply them together.

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 Manifest Basics
Apply YAML file
Create or update resources from a YAML file.
OpenIn sheetbashsame section
Preview manifest changes
See what apply would change.
OpenIn sheetbashsame section
Minimal Pod manifest
Smallest practical Pod YAML shape.
OpenIn sheetyamlsame section
Multiple resources in one YAML file
Separate resources with `---`.
OpenIn sheetyamlsame section
Get resources by label selector
Use labels to query related objects.
OpenIn sheetbash1 tag match
Explain a field path
Discover valid YAML fields from kubectl.
OpenIn sheetbash1 tag match