kubectl Command Examples

Command-line interface for running commands against Kubernetes clusters. Some subcommands such as kubectl run have their own usage documentation. More information: https://kubernetes.io/docs/reference/kubectl/.

kubectl get {{pod|service|deployment|ingress|...}} -o wide

kubectl label pods {{name}} unhealthy=true

kubectl get all

kubectl top {{pod|node}}

kubectl cluster-info

kubectl explain {{pods.spec.containers}}

kubectl logs {{pod_name}}

kubectl exec {{pod_name}} -- {{ls /}}