A parks-api Service suddenly includes unintended Pods from a batch Job that reused the label app=parks. What should the developer change so only the API Deployment Pods receive Service traffic?
Select an answer to reveal the explanation.
Short Explanation
Labels are membership badges—if Jobs wear the same badge as the API, the Service invites them too. Narrow the selector so only the real API Pods match. Traffic-policy tweaks and ExternalName do not fix an over-broad label match.
Full Explanation
A Service selects Pods by label equality. Shared, coarse labels such as app=parks can pull Jobs, CronJobs, or other workloads into the same Endpoints set. Refine selectors with additional discriminating labels so only the Deployment’s Pods match. externalTrafficPolicy and ExternalName do not filter by workload kind, and removing the Service forces brittle Pod IP coupling.