Pranjal Mittal
Pranjal Mittal

Reputation: 11422

How to check the containers running on a pod in kubernettes?

I am able to get a list of all pods running on a kubernetes cluster using:

kubectl get pods

How do I get all the containers running on a particular pod?

Upvotes: 5

Views: 9579

Answers (3)

user9737457
user9737457

Reputation: 11

kubectl describe pod podname, if you would like get the image name of the container in the pod then kubectl get pods -o=jsonpath="{.items[*].spec.containers[*].image}" -l key=value.

Upvotes: 1

shubham_asati
shubham_asati

Reputation: 687

Use -

kubectl describe pod pod_name

Upvotes: 1

Jon Skeet
Jon Skeet

Reputation: 1499760

You can use the describe command:

kubectl describe pod [podname]

That will specify which containers are in the pod, along with other information.

Upvotes: 14

Related Questions