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}'
Advertisements

Example

$ kubectl get pods airflow-scheduler-68546a9b67-7slrj -o jsonpath='{.spec.containers[*].name}'
airflow-web
See also  unable to create listener: Error listen tcp4 0.0.0.0:443: bind: permission denied - Fix in Ubuntu

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.