kubernetes – How to list containers and its info running a pod using kubectl command

When we run kubectl get pod => it is listing the count of containers running inside a pod and restart count. So I am not sure which container gets restarted. Either I need to login to UI or using kubectl describe pods.

NAME       READY   STATUS    RESTARTS   AGE
test-pod   2/2   Running      5         14h

But I need to see each container names and its restart count using kubectl command somethings as below.

NAME            STATUS    RESTARTS    AGE
container-1     Running      2         14h
container-2     Running      3         14h

It would be helpful if someone helps me on this. Thanks in advance!

Read more here: Source link