Skip to main content

kubectl Command Reference

v1.0.0

Browse kubectl commands with flags, examples, and tips for Kubernetes cluster management.

kubectl getBasics

List one or more resources.

Syntax

kubectl get <resource> [name] [flags]

Common Flags

-n, --namespaceSpecify namespace
-o, --outputOutput format: json|yaml|wide|name
-A, --all-namespacesList across all namespaces
-l, --selectorFilter by label selector
--watchWatch for changes

Example

kubectl get pods -n kube-system
kubectl get all -A
kubectl get pod my-pod -o yaml