Selector in service should match deployment or service?

created a deployment(labels: a=b) and service for deployment. the pod inside the deployment has labels: c=d. so my doubt is should the selector in service be the label of pod c=d or label of deployment a=b?

This is the correct approach. :point_up_2:

because the service endpoints are pods IP address?

Yeah,
Please read this doc -