knetvis - Kubernetes Network Policy Visualizer
January 11, 2025 ยท View on GitHub
A powerful CLI tool for visualizing and testing Kubernetes Network Policies.
Features
- ๐ฏ Visual Network Policy Analysis: Generate clear visualizations of your network policies
- ๐ Policy Testing: Test connectivity between pods and services
- โ Policy Validation: Validate network policies before applying them
- ๐ Cross-Namespace Support: Analyze policies across multiple namespaces
Demo

Quick Start
# Install knetvis
pip install knetvis
# Visualize network policies in a namespace
knetvis visualize my-namespace
# Test connectivity between pods
knetvis test pod/frontend pod/backend
# Validate a policy file
knetvis validate policy.yaml
Installation
Prerequisites
- Python 3.8 or higher
- Access to a Kubernetes cluster
- kubectl configured with cluster access
Install Methods
# Via pip
pip install knetvis
# From source
git clone https://github.com/yourusername/knetvis.git
cd knetvis
pip install -e .
Usage Examples
Visualizing Network Policies
# Basic visualization
knetvis visualize production -o network.png
# Show cross-namespace connections
knetvis visualize production --show-external
Testing Connectivity
# Test pod-to-pod connectivity
knetvis test pod/frontend pod/backend
# Test with namespace specification
knetvis test namespace/front/pod/web namespace/back/pod/api
Validating Policies
# Validate a single policy
knetvis validate policy.yaml
# Validate multiple policies
knetvis validate -d policies/
Documentation
Contributing
We welcome contributions! Please see our Contributing Guide for details.
- Fork the repository
- Create your 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
License
This project is licensed under the MIT License - see the LICENSE file for details.
Support
- ๐ซ GitHub Issues
- ๐ฌ Discussions
- ๐ Wiki
Acknowledgments
- The Kubernetes community
- All contributors and maintainers