labelSelector to filter pods


I tried first to describe my setup, but looks like I just don’t understand the concept of the labelSelector property of the k8s namer.

Apparently, I am not obliged to label services, I can label pods. But linkerd won’t route properly in this case.

I just wanted to route 90% of service A traffic to pods of this service labeled env=prod and the rest to env=test.

I see that linkerd routes 90% to prod service and 10% to test service on the graphs (I don’t even have such services “prod” and “test”!), but in fact prod and test pods receive traffic 50/50.

If I don’t label a pod, I must label the service, otherwise “no route to host”.

If linkerd is supposed to take the pods labels into account, it should route properly, I assume. Otherwise I’d expect a routing error like if there were no labels at all.


Hmmm… I think you may be correct that the label selector is being applied to the service and not to the pods. I agree that this is probably less useful. Would you mind opening a linkerd issue on github?

I don’t mind!

Thanks @smartptr! Appreciate it.