⌂ Home
kubectl Essentials
Interactive guide to the everyday create, inspect, expose, scale, debug, and cleanup workflow with kubectl.
kubectl is not just a collection of commands. It supports a repeatable operational loop: create, inspect, expose, change, debug, and clean up.
Core Model
Understand the Concept First
Imperative creation
Fast for learning, testing, and one-off actions.
Inspection is central
get, describe, logs, and events reveal what the cluster is really doing.
Declarative bridge
dry-run and YAML output help users move from imperative commands to versioned manifests.
Lifecycle Flow
kubectl Command Execution Flow
Most kubectl fluency comes from understanding which command category to reach for at each stage of that operator loop.
YAML and Commands
Examples You Can Recognize Quickly
Core Commands
kubectl create deployment myapp1 --image=docker.io/openshift/hello-openshift
kubectl get pods
kubectl describe deployment myapp1
kubectl scale deployment myapp1 --replicas=3
Generate YAML
kubectl create deployment myhttpd --image=docker.io/httpd --dry-run=client -o yaml > myapp1.yaml
Decision Guide
Imperative vs Declarative Use
| Mode |
Strength |
Typical use |
| Imperative |
Fast and direct |
Learning, quick tests, ad hoc changes |
| Declarative |
Repeatable and versionable |
Team workflows, Git-based operations, long-term management |
Strong operators usually know both styles and switch between them intentionally.
Use It Well
Practice and Real-World Thinking
Fast lab work
Use imperative commands to move quickly while learning.
Better debugging
Use describe, logs, and events together to form a full picture.
Manifest generation
Use dry-run YAML output as a starting point for cleaner manifests.