...
- kubectl get ns -A
- kubectl get pods - n <namespace>
- kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName
- kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | awk '{print $2}'. // get the node name
- kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | grep <release name>. // get the pod and node names for release name
- kubectl get pod -o=custom-columns=NAME:.metadata.name,NODE:.spec.nodeName | grep <release name> | awk '{print $2}'. // get the node name for release name
- kubectl describe pods <pod name> // get a pod description
- kubectl describe pods <pod name> | grep 'Container ID'. // get container id(s) from a pod
- kubectl get pod <pod name> -o="custom-columns=NAME:.metadata.name,INIT-CONTAINERS:.spec.initContainers[*].name,CONTAINERS:.spec.containers[*].name". // get pod, init-container and containers
- kubectl get pods <pod name> -o jsonpath='{range .spec.containers[*]}{.name}{"\n"}{end}'. // get container name(s) from the pod name
- kubectl exec -it <pod name> -c <container name> bash. // access pod