All Tools View Categories About Contact Privacy

NetworkPolicy Rule Builder

Build a valid Kubernetes NetworkPolicy (networking.k8s.io/v1) with visual ingress and egress rules.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.

Peers: one per line - "podSelector role=frontend", "namespaceSelector role=api", "ipBlock 10.0.0.0/16 except 10.0.0.5/32". Ports: "TCP 6379" per line.

0
ingress rules
0
egress rules
Your generated NetworkPolicy YAML will appear here.

About NetworkPolicy Rule Builder

NetworkPolicies control pod-to-pod and pod-to-network traffic. The NetworkPolicy Rule Builder writes a networking.k8s.io/v1 NetworkPolicy where you declare which ingress and egress traffic is allowed.

You select target pods with matchLabels, pick Ingress and/or Egress, then add rules. Each rule has peers (podSelector, namespaceSelector or ipBlock) and ports (protocol + port). The resulting YAML is valid networking.k8s.io/v1.

Names are validated as RFC 1123 labels and at least one policy type is required. Problems are reported in a clear panel. Everything runs locally and nothing is uploaded.

Features

  • networking.k8s.io/v1 - correct NetworkPolicy schema.
  • Ingress + Egress - both directions.
  • Peers - podSelector, namespaceSelector, ipBlock (+except).
  • Ports - protocol + port per rule.
  • Validation - RFC 1123 names and required types.
  • Copy / Download / Print - get networkpolicy.yaml wherever you need it.

How to Use

  1. Name the policy and target pods (matchLabels).
  2. Pick Ingress/Egress and add rules with peers + ports.
  3. Watch the preview and export.

Examples

Example 1 - allow frontend. ingress from podSelector role=frontend on TCP 6379.

Example 2 - allow egress to CIDR. egress to 10.0.0.0/24 on TCP 5978.

Example 3 - deny all ingress. ingress type, no rules.

Benefits

  • Correct schema - valid networking.k8s.io/v1 NetworkPolicy.
  • Visual rules - peers and ports per direction.
  • Validated - names and types checked.
  • Clean output - empty fields omitted.
  • Private - everything runs in the browser.
  • Copy, download or print - get the manifest where you need it.

Frequently Asked Questions

What does this build?
A networking.k8s.io/v1 NetworkPolicy that selects pods with a label and declares ingress and/or egress rules made of peers (podSelector, namespaceSelector, ipBlock) and ports.
What peer types are supported?
podSelector, namespaceSelector and ipBlock (with an optional except list).
What if a rule has no peers or ports?
An ingress/egress section with no peers means "allow none" (deny all) for that direction; no ports means "all ports".
Is the name validated?
Yes. The policy name must be a valid RFC 1123 label and at least one policy type must be selected.
Does this connect to a cluster?
No. Everything is assembled in your browser and nothing is uploaded.
Can I download it?
Yes. Copy the YAML, download networkpolicy.yaml, or print it.