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