Command | Description |
---|---|
kubectl -h | Prints the help for kubectl. |
kubectl get pods | Prints a table of pod information in the default namespace. |
kubectl get pods -o wide | Prints additional information showing the node on which the pods are running. |
kubectl get pods -n | Prints a table of pod information in a specific namespace. |
kubectl describe pods <pod name> | Outputs the pod configuration and events. |
kubectl logs <pod name> | Outputs the logs for the container within the pod. If multiple containers are within a pod, it will show the logs for the default container. |
kubectl logs <pod name> -c <container name> | Outputs the logs for a specific container within the pod. Use this when there are multiple containers within a pod and logs are needed for a specific container. |
kubectl get nodes | Prints a table of node information. |
kubectl get namespaces | Prints a table of all namespaces. |