title: How to create NetworkPolicies in Kubernetes that depend on each other
body: <p>I am facing the following scenario:
  For a test case i have create a minikube Kubernetes Cluster with two namespaces (n1, n2)
  both Namespaces contain two nginx deployments:
  <a href="https://i.stack.imgur.com/0FPqF.png" rel="nofollow noreferrer">Two Nginx deployments with two replicas</a></p>
  <p>I know how to create a NetworkPoliy to restrict/allow all access between namespaces but i would like to be able to allow some pod from namespace n1 to access some pod from namespace n2 while still the access to other pods is blocked.</p>
  <p>So for example:
  n1 has pod1 and pod2
  n2 has pod3 and pod4</p>
  <p>I would like pod1 to be able to connect to pod2 and pod3 but NOT to pod4.
  Also i will have no possibility to control the deployments/pods later so i need this solution without using pod labels. I also have the possibility to use calico as a CNI.</p>
  <p>Any ideas are higly appreciated.</p>