Skip to content

🕸️ Visualize CiliumNetworkPolicy without leaving your terminal.

License

Notifications You must be signed in to change notification settings

mostafahussein/kubectl-cnp-viz

Repository files navigation

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.

network-policy-diagram

Installation

Install the browsers and OS dependencies

Note: Instead of installing all browsers, you can specify the browser (e.g. install chrome --with-deps)

go run github.com/playwright-community/playwright-go/cmd/[email protected] install --with-deps

# Or

go install github.com/playwright-community/playwright-go/cmd/[email protected]
playwright install --with-deps

Install the plugin using krew (Recommended)

kubectl krew install cnp-viz

Install the plugin manually

  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.

About

🕸️ Visualize CiliumNetworkPolicy without leaving your terminal.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published