how to list pods by labels code example
Example 1: kubectl to show label of pod
kubectl get pods --show-labels
Example 2: get containers in pod
kubectl get pods POD_NAME_HERE -o jsonpath='{.spec.containers[*].name}'
kubectl get pods --show-labels
kubectl get pods POD_NAME_HERE -o jsonpath='{.spec.containers[*].name}'