Real-time interactive visualization and anomaly detection for Kubernetes clusters.
Kubernetes Network Visualizer is a web-based tool that provides real-time visualization of your Kubernetes cluster topology, complete with intelligent anomaly detection. It helps DevOps teams, developers, and security engineers understand their cluster's network architecture and quickly identify configuration issues.
- Interactive Graph Visualization - Powered by Cytoscape.js
- Real-time Updates - Cluster state refreshed every 10 seconds
- Smart Anomaly Detection - Automatically detects 6 types of configuration issues
- Advanced Search & Filtering - Find resources quickly
- Multiple Graph Layouts - Force-directed, hierarchical, circular, and grid
- Color-coded Health Status - Instant visual feedback
- Hover-to-Reveal Connections - Clean UI that shows edges on demand
Working with Kubernetes networking is challenging:
- No visual representation of cluster topology
- Configuration mistakes are hard to spot
- Debugging connectivity issues requires multiple kubectl commands
- Network policy conflicts are difficult to identify
This tool solves these problems with an intuitive, visual interface.
โโโโโโโโโโโโโโโโโโโ
โ React UI โ โ Cytoscape.js Graph Visualization
โ (Frontend) โ โ Search, Filter, Layout Controls
โโโโโโโโโโฌโโโโโโโโโ
โ HTTP/WebSocket
โโโโโโโโโโผโโโโโโโโโ
โ Flask API โ โ Kubernetes Python Client
โ (Backend) โ โ Anomaly Detection Engine
โโโโโโโโโโฌโโโโโโโโโ
โ REST API
โโโโโโโโโโผโโโโโโโโโ
โ Kubernetes โ โ Pods, Services, Nodes
โ Cluster โ โ Network Policies, Events
โโโโโโโโโโโโโโโโโโโ
The system automatically detects:
- ๐ต Configuration Problems - Services with selectors that don't match pods
- ๐ด Connectivity Failures - Pods in Failed/Pending state
- ๐ DNS Resolution Issues - Custom DNS preventing service discovery
- ๐ก Network Policy Conflicts - Overlapping policies on same pods
- โช Security Gaps - Missing network policies
- ๐ฃ Resource Constraints - Pods with excessive restarts
- Kubernetes cluster (Minikube, Kind, or any K8s cluster)
- kubectl configured
- Docker (for building images)
-
Clone the repository
git clone https://github.com/[your-username]/network-visualizer.git cd network-visualizer -
Build the Docker image
# For Minikube eval $(minikube docker-env) docker build -t network-visualizer:latest -f backend/Dockerfile.python .
-
Deploy to Kubernetes
kubectl apply -f k8s/deployment.yaml
-
Wait for pod to be ready
kubectl wait --for=condition=ready pod -l app=network-visualizer -n network-visualizer --timeout=60s -
Access the UI
kubectl port-forward -n network-visualizer svc/network-visualizer 8080:8080
-
Open browser
http://localhost:8080
To see the visualizer in action with sample microservices:
# Deploy demo application
kubectl apply -f demo-app.yaml
# Deploy anomaly scenarios
kubectl apply -f anomaly-scenarios.yamlThis creates:
- 3 Frontend pods
- 2 Backend API pods
- 1 Redis database
- 2 Payment service pods
- Traffic generators
- Several intentional misconfigurations for anomaly detection
- Hover over nodes to reveal connections
- Click nodes to view detailed information
- Drag nodes to rearrange the graph
- Zoom and pan to explore
- Search bar - Type pod/service/namespace names
- Status filter - Show only healthy/degraded/failed resources
- Type filter - Filter by pods/services/nodes
- Layout options - Switch between different graph algorithms
Check the "DETECTED ISSUES" panel in the sidebar to see:
- Issue type and severity
- Affected resources
- Remediation recommendations
Frontend:
- React 18 with Hooks
- Cytoscape.js (graph visualization)
- WebSocket for real-time updates
- Vanilla CSS
Backend:
- Python 3.11
- Flask (web framework)
- Kubernetes Python Client
- Flask-CORS
Infrastructure:
- Docker
- Kubernetes RBAC
- Minikube (local development)
GET /api/topology- Full cluster topologyGET /api/flows- Network flow dataGET /api/flows/metrics- Flow statisticsGET /api/metrics/traffic- Traffic metricsGET /api/metrics/connections- Connection metricsGET /api/metrics/errors- Error metricsGET /api/issues- Detected anomaliesWS /ws/flows- Real-time flow streaming
The application uses Kubernetes RBAC with:
- ServiceAccount:
network-visualizer - ClusterRole: Read-only access to:
- Pods, Services, Nodes, Namespaces
- Deployments, ReplicaSets, DaemonSets, StatefulSets
- NetworkPolicies, Ingresses
No write permissions - completely read-only.
cd backend
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install -r requirements.txt
python app.pyThe frontend is a single HTML file with inline JavaScript (React via CDN).
Edit frontend/index.html and refresh the browser.
# Build with Docker
docker build -t network-visualizer:latest -f backend/Dockerfile.python .
# For Minikube
eval $(minikube docker-env)
docker build -t network-visualizer:latest -f backend/Dockerfile.python .
kubectl rollout restart deployment/network-visualizer -n network-visualizer- Historical timeline and playback
- Real eBPF-based traffic capture (vs simulated)
- Multi-cluster support
- Prometheus integration
- AI-powered root cause analysis
- Export reports (PDF/JSON)
- Slack/Teams notifications
- What-if scenario simulator
This is a hackathon project, but contributions are welcome!
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
MIT License - feel free to use this in your own projects!
- Built during [Hackathon Name]
- Inspired by Weave Scope, Cilium Hubble, and Kubernetes Dashboard
- Uses Cytoscape.js for graph visualization
- Kubernetes Python Client by the Kubernetes team
- GitHub: [@your-username]
- Email: your.email@example.com
Built with โค๏ธ for the Kubernetes community


