<p>I made deployment with 2 pods:</p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  creationTimestamp: null
  labels:
    app: nginx
  name: nginx
spec:
  replicas: 2
  selector:
    matchLabels:
      app: nginx1
  strategy: {}
  template:
    metadata:
      creationTimestamp: null
      labels:
        app: nginx1
    spec:
      containers:
      - image: nginx
        name: nginx
        resources: {}
        ports:
        - containerPort: 80
status: {}
</code></pre>
<p>Then exposed it with clusterip, then created a networkpolicy like below:</p>
<pre><code>apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: test-network-policy
  namespace: default
spec:
  podSelector:
    matchLabels:
      app: nginx1
  policyTypes:
  - Ingress
  ingress:
  - from:
    - podSelector:
        matchLabels:
          role: frontend
</code></pre>
<p>But when i request it via wget using busybox pod which DOES NOT contain the label (role=frontend), i still getting the html page of nginx.</p>
<p>I would like to know why ?</p>
<p>Any help would be really appriciated. Thank you :)</p>

<p>If your k8s cluster is deployed with <code>Container Network Interface (CNI)</code> plugin that does not support network policies, it will not have an impact on it. From <a href="https://kubernetes.io/docs/concepts/services-networking/network-policies/#prerequisites" rel="nofollow noreferrer">k8s docs</a>:</p>
<blockquote>
<p>Network policies are implemented by the network plugin. To use network policies, you must be using a networking solution which <strong>supports NetworkPolicy</strong>. Creating a NetworkPolicy resource without a controller that implements <strong>it will have no effect.</strong></p>
</blockquote>
