Thanks for asking the question.
In this question we only want to allow the pods with labels backend=prod-x12cs that exists in the namespace prod-x12cs.
allow traffic from all pods in namespace with label function: redis-backend ( not needed ) and pods with labels prod-x12cs in namespace where network policy is created ( needed to complete the task).
And yes for 2nd namespace ( prod-yx13cs ) we need to add another rule in the same NetPol.
A short definition from Kubernetes docs is as follows:
podSelector: This selects particular Pods in the same namespace as the NetworkPolicy which should be allowed as ingress sources or egress destinations.
Please take a look at the below link for in-depth explanation:
Hope this helps.
Let us know if you have any other queries.