kubectl

Kubectl command to list pods of a deployment in Kubernetes

好久不见. 提交于 2020-12-01 08:59:27
问题 Is there a way to use kubectl to list only the pods belonging to a deployment? Currently, I do this to get pods: kubectl get pods| grep hello But it seems an overkill to get ALL the pods when I am interested to know only the pods for a given deployment. I use the output of this command to see the status of all pods, and then possibly exec into one of them. I also tried kc get -o wide deployments hellodeployment , but it does not print the Pod names. 回答1: There's a label in the pod for the