Inspect, debug, deploy and scale — the kubectl commands you reach for on any cluster. Tap to copy.
kubectl get podsList pods in the current namespacekubectl get pods -AList pods across all namespaceskubectl get svcList serviceskubectl get nodesList cluster nodeskubectl get deploymentsList deploymentskubectl describe pod <name>Show detailed info and events for a podkubectl logs <pod>Print a pod's logskubectl logs -f <pod>Stream a pod's logs livekubectl exec -it <pod> -- bashOpen a shell inside a podkubectl port-forward <pod> 8080:80Forward a local port to a podkubectl top podsShow CPU and memory usage per podkubectl apply -f <file>.yamlCreate or update resources from a filekubectl delete -f <file>.yamlDelete the resources defined in a filekubectl delete pod <name>Delete a podkubectl scale deploy <name> --replicas=3Scale a deployment to N replicaskubectl rollout restart deploy <name>Restart a deployment's podskubectl config get-contextsList available cluster contextskubectl config use-context <name>Switch the active cluster contextkubectl get nsList namespaceskubectl config set-context --current --namespace=<ns>Set the default namespaceDay-to-day Kubernetes is mostly kubectl get to see what's running, kubectl logs and kubectl exec to debug, and kubectl apply -f to ship changes. Remember that most commands act on your current namespace and context — check them with kubectl config get-contexts before making changes.