Skip to content

Menu

Kubernetes NetworkPolicy Visualizer

Paste Kubernetes NetworkPolicy YAML and a list of pods to see which ingress and egress connections are allowed on each port. Runs in your browser.

Runs entirely in your browserDevOpsFree, no sign-up
Loading tool
When a pod-to-pod connection is allowedBoth sides must allow it: the source's egress side, or the source isn't egress-isolated, and the destination's ingress side, or it isn't ingress-isolated.Source pod → destination pod, portSource egressa rule allows it, ornot isolatedDest ingressa rule allows it, ornot isolatedBoth sides allow?no → DENY, with the reasonALLOW
Both sides must allow it: the source's egress side, or the source isn't egress-isolated, and the destination's ingress side, or it isn't ingress-isolated.

01What is Kubernetes NetworkPolicy Visualizer?

A Kubernetes NetworkPolicy is easy to write and hard to read back. One misplaced dash turns an AND into an OR, and a missing policyTypes entry changes which direction is locked down. This tool takes your NetworkPolicy YAML, a list of pods with labels, and the ports you care about. It then lists every pod-to-pod connection as ALLOW or DENY, with the reason for each side. The rules follow the Kubernetes documentation. A pod is isolated for ingress or egress only when some policy selects it and lists that direction. Without policyTypes, Ingress is always set and Egress is set only when the policy has an egress section. Policies add up, and there is no deny rule. A connection is allowed when the source's egress side allows it, or the source is not egress-isolated, and the destination's ingress side does the same. Peers in separate list items are ORed. A namespaceSelector and podSelector in the same item are ANDed. A podSelector alone matches pods in the policy's own namespace. A rule with no peers matches every source, and a rule with no ports matches every port. Ports default to TCP, endPort sets a range, and a named port is matched against the destination pod's declared ports. Selectors support matchLabels and matchExpressions with In, NotIn, Exists and DoesNotExist. Any other operator stops the run with an error that names the policy. Every namespace gets the kubernetes.io/metadata.name label automatically, as in a real cluster, so you can pick a namespace by name. Here is a worked case from the Database lock-down example. The policy db-allow-api selects app=db in prod and allows ingress from app=api on 5432. The tool reports prod/api to prod/db on TCP/5432 as ALLOW, with ingress "allowed by db-allow-api". The same call from prod/web is DENY, with ingress "isolated by db-allow-api, no rule matches". Port 80 to the database is denied for everyone. Pods that no policy selects stay open, so web to api shows "not isolated" on both sides. The YAML reader is a small parser written for this tool. It handles block mappings and lists, flow style like [Ingress] and {app: web}, quoted strings, comments and --- separators. It rejects anchors, tags and block scalars. ipBlock peers are not matched against pod traffic, so a rule that only lists an ipBlock never allows a pod here. Traffic from a pod's own node, which Kubernetes always allows, is not shown. Policies only have an effect if your CNI plugin enforces them. Everything runs in your browser.

Platform engineers, SREs and developers who write or review Kubernetes NetworkPolicies. The tool runs entirely in your browser, so your data never leaves your device.

02How to use Kubernetes NetworkPolicy Visualizer

  1. Paste one or more NetworkPolicy documents, separated by ---
  2. List your pods as namespace/name followed by labels and any named ports
  3. Add labels for namespaces that your namespaceSelectors refer to
  4. Enter the ports to test, such as 80 or UDP/53
  5. Read each connection's verdict and the egress and ingress reasons

03Worked examples

Input: Database lock-down: db-allow-api selects app=db in prod, ingress from app=api on 5432. Ports 5432, 80.
Result: prod/api -> prod/db TCP/5432: ALLOW (egress: not isolated; ingress: allowed by db-allow-api) prod/web -> prod/db TCP/5432: DENY (egress: not isolated; ingress: isolated by db-allow-api, no rule matches) prod/api -> prod/db TCP/80: DENY (egress: not isolated; ingress: isolated by db-allow-api, no rule matches)
Trimmed to the rows that involve prod/db. Pods with no policy show ALLOW with not isolated on both sides.
Input: Default deny + named port: default-deny and web-to-api both select all prod pods. Ingress from app=web on port name http, egress to app=api. prod/api declares http:8080/TCP.
Result: prod/web -> prod/api TCP/8080: ALLOW (egress: allowed by web-to-api; ingress: allowed by web-to-api) prod/web -> prod/api TCP/5432: DENY (egress: allowed by web-to-api; ingress: isolated by default-deny, web-to-api, no rule matches)
The named port http resolves to 8080 on the destination pod, so 5432 does not match.
Input: Cross-namespace AND: allow-monitoring in prod allows namespaceSelector team=ops plus podSelector role=monitor in one peer, ports 9000-9100. Port 9090.
Result: ops/prometheus -> prod/db TCP/9090: ALLOW (egress: not isolated; ingress: allowed by allow-monitoring) dev/prometheus -> prod/db TCP/9090: DENY (egress: not isolated; ingress: isolated by allow-monitoring, no rule matches)
Both pods have role=monitor, but only the ops namespace has team=ops.
Input: Egress allow-list: api-egress lets app=api reach app In [db] on 5432, namespace ops by kubernetes.io/metadata.name on 9090, and ipBlock 0.0.0.0/0 on 443. Ports 5432, 9090, 443.
Result: prod/api -> prod/db TCP/5432: ALLOW (egress: allowed by api-egress; ingress: not isolated) prod/api -> ops/prometheus TCP/9090: ALLOW (egress: allowed by api-egress; ingress: not isolated) prod/api -> prod/web TCP/443: DENY (egress: isolated by api-egress, no rule matches; ingress: not isolated)
Trimmed. The ipBlock rule never matches pod-to-pod traffic in this tool.
Input: typo-policy with matchExpressions operator: Equals
Result: typo-policy: unknown matchExpressions operator "Equals"

04Common use cases

  • Checking that a default-deny policy plus allow rules gives the access you expect
  • Finding out why a pod cannot reach a database after a policy change
  • Spotting a namespaceSelector and podSelector that were meant to be ANDed but were written as two peers
  • Reviewing a NetworkPolicy in a pull request before applying it
  • Testing named ports and port ranges against real pod port declarations
  • Confirming that an egress allow-list for one service still lets it reach its database and metrics endpoint
  • Catching a typo in a matchExpressions operator before kubectl apply rejects it

05Tips

  • Use the Allowed only box to see the open paths at a glance
  • If a pod is not selected by any policy for a direction, it is open in that direction
  • Remember to allow DNS egress on UDP 53 when you add an egress policy
  • Select a namespace by name with the kubernetes.io/metadata.name label
  • Read the egress and ingress reasons separately, since one blocked side is enough to deny a connection

06Related concepts

NetworkPolicy, podSelector, namespaceSelector, policyTypes, label selector, CNI plugin.

Frequently Asked Questions

What is Kubernetes NetworkPolicy Visualizer?

Kubernetes NetworkPolicy Visualizer is a free, browser-based developer tool on AIDToolStack. Paste Kubernetes NetworkPolicy YAML and a list of pods to see which ingress and egress connections are allowed on each port. Runs in your browser. It requires no installation or sign-up and works entirely in your browser.

Is Kubernetes NetworkPolicy Visualizer free to use?

Yes. No sign-up, no fees and no usage cap.

Does Kubernetes NetworkPolicy Visualizer store my data?

No. It runs in your browser; nothing is uploaded.

Related Tools

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe