<p>I want to block traffic between nodes in kubernetes.</p>
<p>This is because i don't want to have any effect on the traffic coming from the specfic pod.</p>
<p>how can do this?</p>

Jaejung Lee
<p>You can use network policies for this. The following example of a network policy blocks all in-cluster traffic to a set of web server pods, except the pods allowed by the policy configuration.</p>
<p>To achieve this setup, create a NetworkPolicy with the following manifest:</p>
<pre><code>kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
  name: access-nginx
spec:
  podSelector:
    matchLabels:
      app: nginx
  ingress:
  - from:
    - podSelector:
        matchLabels:
          app: foo
</code></pre>
<p>Once you apply this configuration, only pods with label</p>
<blockquote>
<p>app: foo</p>
</blockquote>
<p>can talk to the pods with the label</p>
<blockquote>
<p>app: nginx.</p>
</blockquote>
