Basic Kubernetes Commands for troubleshooting

To view all nodes in cluster:

$ kubectl get nodes

To view the running containers in current namespace:

$ Kubectl get pods -o wide

To view all pods (containers):

$ Kubectl get pods --all-namespaces

To view all namespaces:

$ Kubectl get namespaces

To view the logs for a specific container:

$ kubectl logs -f pod name

To view the configuration for a specific container:

$ kubectl describe pods/pod name

To enter a bash shell of a container:

$ kubectl exec -ti pod name -- /bin/sh
$ exit