Is there any difference in labels and selector field because I have to set netpol for a service and I am trying to find out the labels for that but when I did -o wide I got selector field which I used in netpol.
selector uses labels to make selections.
Means if we expose pod as a service then it will automatically fetches pod label
yes…it fetches the label. In test though the same label would be present in other pods and it would create mess; we always need to double scan for labels on all possible nods.