Scenario: List all the pods that are serviced by the service “webservice”and cop . . .

Munish Kumar Anand:
Scenario: List all the pods that are serviced by the service “webservice”and copy the output in /opt/webservice.targets
My Solution:
kubectl get ep webservice
But this shows only IP:port. So in this case, do I need to match IP returned by above command with the IPs of PODs and copy into mentioned file?

Deepak Ladwa:
Service selector will be mapped to pod labels. So, you can use kubectl get pods -l label_name=key

Deepak Ladwa:
Example:
kubectl get pods -l app=env -o name > file

Munish Kumar Anand:
Perfect, thanks Deepak.