Skip to content

Get container name using pod name with kubectl

To get container name using pod name with kubectl, just run the following command.

kubectl get pods <pod-name> -o jsonpath='{.spec.containers[*].name}'


$ kubectl get pods airflow-scheduler-68546a9b67-7slrj -o jsonpath='{.spec.containers[*].name}'
See also  Get all service accounts using kubectl

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.