Skip to main content

Command line interface for running commands against Kubernetes clusters.

# To list all information about a resource with more details:
kubectl get <pod|service|deployment|ingress|...> -o wide

# To update specified pod with the label 'unhealthy' and the value 'true':
kubectl label pods <name> unhealthy=true

# To list all resources with different types:
kubectl get all

# To display resource (CPU/Memory/Storage) usage of nodes or pods:
kubectl top <pod|node>

# To print the address of the master and cluster services:
kubectl cluster-info

# To display an explanation of a specific field:
kubectl explain <pods.spec.containers>

# To print the logs for a container in a pod or specified resource:
kubectl logs <pod_name>

# To run command in an existing pod:
kubectl exec <pod_name> -- <ls />