YAML is a human-readable, machine-rendered format for describing Kubernetes configuration. Kubernetes manifests express desired state, can be version-controlled, and let the API reconcile the cluster toward that state. section 1.9
Use YAML manifests to:
- Describe a resource without scripting each operation or depending on command order. section 1.9
- Document application configuration and track changes through version control. section 1.9
- Generate, edit, and apply pod definitions with kubectl, then verify results with kubectl get. section 1.9 section 8.1.1
Applying a pod manifest
A manifest such as my-pod-manifest.yaml can define an nginx Pod with apiVersion, kind, metadata, and spec fields. Apply it with kubectl create -f my-pod-manifest.yaml or kubectl apply -f pod.yaml, then inspect the resulting Pod with kubectl get po. section 1.9 section 8.1.1
apiVersion: v1
kind: Pod
metadata:
labels:
run: nginx
name: nginx
spec:
containers:
- image: nginx
name: nginx
Inspect a compact Pod manifest showing YAML's recurring Kubernetes resource structure. section 1.9















