kubectl
ExplainedTool
Command-line tool for managing Kubernetes clusters: inspecting pods, deploying and scaling.
kubectl, explained
Written by EduVerseWhat it is
kubectl is the command-line tool for talking to a Kubernetes cluster. Every command sends a request to the cluster’s API: list what’s running, read logs, apply configuration from YAML files, or scale a deployment up and down. Which cluster it talks to is set in a config file, usually ~/.kube/config.
Why teams use it
Kubernetes spreads your application across many containers and machines, so you can’t just log into one server to see what’s wrong. kubectl gives you one consistent way to inspect and change everything in the cluster. Graphical dashboards exist, but kubectl works everywhere and is what scripts and documentation rely on.
An example from work
The staging version of your service isn’t responding. You run kubectl get pods and see its pod with the status CrashLoopBackOff and a growing restart count. Running kubectl logs with the pod’s name shows the reason: the app can’t find a required environment variable and exits on startup.
Our own explanation, not a quote from the book.
In the book
Sentences from The Software Realm, Decoded that mention kubectl, exactly as printed.
1 more passages about kubectl in the full book
Read every conversation where kubectl comes up, with the interactive slides and demos.
Where it fits
Managing and inspecting Kubernetes resources
Coverage in the book
Explained and compared with alternatives, so you know where and why it’s used.