Kubernetes NetworkPolicy Generator

Generate Kubernetes NetworkPolicy manifests to secure your cluster. Define precise ingress and egress rules using pod selectors and namespaces to enforce Zero Trust networking.

Network Policy Configuration

Metadata

Policy Target & Types

Pods matching these labels are governed by this policy. Empty = all pods.

- Restrict who can send traffic TO the selected pods
- Restrict where selected pods can SEND traffic

Ingress Rules (Allowed Incoming Traffic Sources)

Allow from all pods in matching namespaces

Allow from pods matching these labels

Egress Rules (Allowed Outgoing Traffic Destinations)

network-policy-configuration.yaml
1

Kubernetes NetworkPolicy Generator

Overview

Generate Kubernetes NetworkPolicy manifests. By default, pods are non-isolated; they accept traffic from any source. NetworkPolicies allow you to define rules that restrict which pods can communicate with each other or external IP blocks.

Frequently Asked Questions

Do I need a specific CNI for NetworkPolicies?
Yes. NetworkPolicies are implemented by the network plugin (CNI). Your cluster must use a CNI that supports NetworkPolicy enforcement, such as Calico, Cilium, Weave Net, or Antrea. Flannel alone does not enforce them.
How do I implement a Default Deny All policy?
To implement a 'Default Deny All' policy for a namespace, create a NetworkPolicy with an empty podSelector `{}` and include both `Ingress` and `Egress` in the policyTypes list, without specifying any rules.