I am trying to get the list of pods that are servicing a particular service
There are 3 pods associated with my service.
I tried to execute the below command
oc describe svc my-svc-1
I am expecting to see the pods associated with this service. but that does not show up. What command gets me just the list of pods associated with the service.
A service chooses the pods using the selector. Look at the selector for the service, and get the pods using that selector. For kubectl, the command looks like:
kubectl get pods --selector <selector>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.