1. Namespace flag
-n selects the namespace; without it kubectl uses the current context's namespace.
-n defaultTyporithm · easy
Step 1 of 8 · intro card
kubectl Commands
kubectl get lists resources; flags shape the view — -n for namespace, -o wide for detail, -l to filter by label, --watch to stream changes.
kubectl get is the workhorse for inspecting cluster state, from pods to deployments to nodes.
Flags refine it: -n picks the namespace, -o wide or -o yaml change the output, -l filters by label.
--watch keeps the command open and prints updates live, useful while a rollout progresses.
-n <namespace> scopes the query.
-o wide / -o yaml change output.
-l key=value filters by label.
kubectl get pods -n default
kubectl get pods -o wide
kubectl get deploy -l app=web
kubectl get pods --watchConnect each part of the code to the concept before you type.
-n selects the namespace; without it kubectl uses the current context's namespace.
-n default-o wide adds node and pod-IP columns to the listing.
-o wide-l filters resources by label key=value.
-l app=web--watch streams resource changes as they happen.
--watchRead the concept map and follow the code breakdown.
Type the implementation, repair mistakes and work through every recall exercise.
Use the final check without hints; revisit weak concepts in short practice sessions.