Hello While exposing service we need to use labels of pod or deployment ? Here . . .

I Malla:
Hello

While exposing service we need to use labels of pod or deployment ? Here I am asking for pod controlled by deployment

If we expose standalone pod , we give selector value as label of pod obviously

If we expose deployment, we give value of deployment ? Or of pod inside the template ?

Kubectl expose deployment deploy_name --name=service_name

Another question is , we don’t have to keep the labels of deployment and pod same right ?

Fernando Jimenez:

Another question is , we don't have to keep the labels of deployment and pod same right ?

They do not have to be the same. A deployment might have a release label, and a pod might have a pod version. Different labels. However, both might have a common label that reference the name of an application.