Log
See log of the pods that match a pattern
kubectl logs -n <namespace> $(kubectl get pod -n <namespace> | awk '/<pattern>/{print $1}') -fExample:
kubectl logs -n kube-system $(kubectl get pod -n kube-system | awk '/kube-proxy*/{print $1}') -fSee logs of all container in a pod
Use --all-containers flag.
kubectl logs my-pod --all-containersSee logs of a container that has crashed
Use --previous (short -p) flag.
kubectl logs my-pod --previousLast updated
Was this helpful?