network-policy-viewer
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

Kubernetes Network Policy Viewer

ONLINE DEMO BETA: You also can edit NetworkPolicy in the editor and visualisation will update as you type

NetworkPolicy viewer screenshot

View your Kubernetes NetworkPolicy manifests as graph, just Copy and Paste YAML to the editor and receive instant visualisation

This, hopefully, can help you find issues with NetworkPolicies or understand NetworkPolicy concept better

Related projects

Installation

npm install network-policy-viewer

Usage

NetworkPolicyViewer can be used as React component, see the sample below or view demo source code

import React from 'react';
import ReactDOM from 'react-dom';
import { NetworkPolicyViewer } from "network-policy-viewer";
import "network-policy-viewer/index.css"

const networkPolicy = `
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
  name: default-deny-ingress
spec:
  podSelector: {}
  policyTypes:
  - Ingress
`;

ReactDOM.render(
    <NetworkPolicyViewer
        networkPolicy={networkPolicy}
        style={{ display: "flex", width: "100%", height: '100vh' }}
        canvasStyle={{ width: "100%", height: '100vh'}}
    />,
    document.getElementById('root')
);

Credits

License

MIT license

Package Sidebar

Install

npm i network-policy-viewer

Weekly Downloads

2

Version

2.0.1

License

MIT

Unpacked Size

529 kB

Total Files

82

Last publish

Collaborators

  • artturik