title: Network policy to restrict communication of pods within namespace and port
body: <p>Namespace 1: arango</p>
  <p>Namespace 2: apache - 8080</p>
  <p>Criteria to acheive:</p>
  <p>The policy should not allow pods which are not listening in port 8080</p>
  <p>The policy Should not allow pods from any other namespace except &quot;arango&quot;</p>
  <p>Is the following ingress help acheive this? or is it manadtory to add egress as there are rules to deny other namespace pods and ports except 8080?</p>
  <pre><code>apiVersion: networking.k8s.io/v1
  metadata:
    name: access-nginx
  spec:
    podSelector:
      matchLabels:
        app: arango
    ingress:
    - from:
      - podSelector:
          matchLabels:
            app: apache
      ports:
      - protocol: TCP
        port: 8080
  </code></pre>