A visual tool for Kubernetes network policies that uses a Canvas draw board to visualize and edit network policies, admin network policies, and base admin network policies in an interactive GUI.
- Visual Representation: Canvas-based visualization of Kubernetes network policies
- Multiple Policy Types: Support for:
- NetworkPolicy
- AdminNetworkPolicy
- BaseAdminNetworkPolicy
- Interactive Visualization:
- Visualize relationships between namespaces, pods, and network rules
- Ingress and egress traffic flow visualization
- Drag and drop nodes for better layout
- Policy Editor: Built-in YAML editor for creating and editing policies
- Real-time Updates: Instant visualization as policies are loaded
- Namespaces (Blue rectangles): Kubernetes namespace selectors
- Pods (Green circles): Pod selectors based on labels
- External (Orange circles): External IP blocks or any traffic
- Ingress (Solid blue arrows): Incoming traffic rules
- Egress (Dashed purple arrows): Outgoing traffic rules
- Allow (Green): Allowed traffic (Admin policies)
- Deny (Red): Denied traffic (Admin policies)
- Pass (Yellow): Pass traffic to next policy (Admin policies)
npm installThe latest container image is continuously deployed to Railway at https://network-visualizer-production.up.railway.app/.
npm run devnpm run buildnpm run previewnpm run lintPull the latest published image from GitHub Container Registry and run it locally (exposes nginx on port 80 inside the container):
docker pull ghcr.io/q-efx/network-visualizer:latest
docker run -p 8080:80 ghcr.io/q-efx/network-visualizer:latest- Load Example: Click "Load Example" to see sample policies
- Edit Policies: Write or paste your Kubernetes network policy YAML in the editor
- Visualize: Click "Visualize" to render the policies on the canvas
- Interact: Drag nodes to rearrange the visualization layout
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: api-allow
namespace: default
spec:
podSelector:
matchLabels:
app: api
policyTypes:
- Ingress
- Egress
ingress:
- from:
- podSelector:
matchLabels:
app: frontend
ports:
- protocol: TCP
port: 8080
egress:
- to:
- podSelector:
matchLabels:
app: database
ports:
- protocol: TCP
port: 5432- React 18: UI framework
- TypeScript: Type-safe development
- Konva & React-Konva: Canvas rendering library
- Vite: Build tool and dev server
network-visualizer/
├── src/
│ ├── components/
│ │ ├── CanvasVisualizer.tsx # Canvas drawing component
│ │ ├── PolicyEditor.tsx # YAML editor component
│ │ └── Legend.tsx # Legend component
│ ├── types/
│ │ └── policies.ts # TypeScript type definitions
│ ├── utils/
│ │ └── policyParser.ts # Policy parsing logic
│ ├── App.tsx # Main application
│ ├── App.css # Application styles
│ ├── main.tsx # Entry point
│ └── index.css # Global styles
├── index.html
├── package.json
├── tsconfig.json
└── vite.config.ts
MIT