https://github.com/mostafahussein/kubectl-cnp-viz
:spider_web: Visualize CiliumNetworkPolicy without leaving your terminal.
https://github.com/mostafahussein/kubectl-cnp-viz
cilium kubectl kubectl-plugins kubernetes
Last synced: 7 months ago
JSON representation
:spider_web: Visualize CiliumNetworkPolicy without leaving your terminal.
- Host: GitHub
- URL: https://github.com/mostafahussein/kubectl-cnp-viz
- Owner: mostafahussein
- License: apache-2.0
- Created: 2025-02-21T16:17:17.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-02-21T18:08:16.000Z (8 months ago)
- Last Synced: 2025-02-21T19:24:42.143Z (8 months ago)
- Topics: cilium, kubectl, kubectl-plugins, kubernetes
- Language: Go
- Homepage:
- Size: 462 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# CiliumNetworkPolicy Visualizer
## Overview
A `kubectl` plugin that fetches a given `CiliumNetworkPolicy` resource from the cluster, uploads it to `editor.networkpolicy.io` to generate a diagram, and saves the diagram locally.

## Installation
### Using krew (Recommended)
```
kubectl krew install cnp-viz
```### Manual Installation
1. Download the latest release from GitHub Releases.
2. Move the binary to a directory in your `$PATH`, for example:
```
mv kubectl-cnp-viz /usr/local/bin/ubectl-cnp_viz
chmod +x /usr/local/bin/kubectl-cnp_viz
```## Usage
### Visualize a given network policy
```
kubectl cnp-viz -n my-namespace service-np
```### Resize the diagram
```
kubectl cnp-viz -n my-namespace service-np --scale 2
```### Move the diagram horizontally
```
kubectl cnp-viz -n my-namespace service-np --x 600
```### Move the diagram vertically
```
kubectl cnp-viz -n my-namespace service-np --y 50
```### Set custom output path
```
kubectl cnp-viz -n my-namespace service-np --output ~/diagrams
```## License
This plugin is open-source and available under the Apache 2.0 License.