Paths/DevOps Engineer/Kubernetes / YAML Manifests
Apply a Manifest
Imperative commands are for learning; YAML manifests are for real life. Write a Pod manifest and apply it — the declarative workflow behind GitOps and ArgoCD.
Validator
IDLE — checks run live as you type commands; submit when done
01Requirements
live checks- File ~/manifests/pod.yaml exists○
- Pod web-yaml is Running○
02Walkthrough
6 steps- 01
Create the manifests directory
Manifests live in the repository in real projects — one place, reviewable.
mkdir ~/manifests - 02
Write the manifest
One echo with \n separators writes the whole file. apiVersion/kind say WHAT the object is; metadata.name names it; spec.containers declares the container. Note the two-space indentation — it's meaningful in YAML.
echo 'apiVersion: v1\nkind: Pod\nmetadata:\n name: web-yaml\nspec:\n containers:\n - name: nginx\n image: nginx:1.27' > ~/manifests/pod.yaml - 03
Review the manifest
cat prints the file. If the indentation looks wrong, rewrite it — YAML is whitespace-sensitive.
cat ~/manifests/pod.yaml - 04
Apply it
kubectl apply -f reads the file and makes the cluster match it. Then kubectl get pods shows web-yaml Running.
kubectl apply -f ~/manifests/pod.yaml - 05
Verify
kubectl get pods should list web-yaml with STATUS Running.
kubectl get pods - 06
Submit for validation
The validator checks the manifest file and the resulting Pod.
03Stuck?
0 of 3 revealedTake a hint without losing the lab — each one points at the thing to look at, not at the answer.
04AI Tutor
guides, never solvesTell me what you're stuck on — I'll nudge, not solve. Which requirement are you looking at?
04Notebook
saved locally in this browserlearner@lab — kubernetes 1.30 (kind)
Session is disposable
↑/↓ recalls commands · Ctrl+Enter submits · type help for the command list