Skip to content

Network policy visualization #58

Description

@syedazeez337

Summary

Visualize network policies showing which pods can communicate and highlighting isolated pods.

Motivation

Network policies are notoriously hard to understand. No K8s TUI shows network connectivity visually. This would be unique and valuable for security-conscious teams.

Requirements

NetworkPolicy Watching

  • Add ResourceKind::NetworkPolicy to watchers
  • Display: Name | Namespace | Pod Selector | Policy Types | Age

Visualization (preview pane)

For a selected pod, show:

Network Policy: allow-web
  Ingress:
    ✓ From: namespace=frontend, port 80/TCP
    ✓ From: 10.0.0.0/8, port 443/TCP
  Egress:
    ✓ To: namespace=backend, port 5432/TCP
    ✗ To: 0.0.0.0/0 (blocked by default deny)

Isolated Pod Detection

  • Highlight pods with no matching network policies
  • Show warning: "No network policy — all traffic allowed (default)"
  • Or: "Default deny active — no ingress/egress rules match"

Implementation

  • Parse NetworkPolicy spec: podSelector, ingress[], egress[]
  • Match pods via label selectors
  • Show as formatted text in preview pane

Acceptance Criteria

  • NetworkPolicy resources browsable in list
  • Preview shows ingress/egress rules in readable format
  • Isolated pods highlighted
  • Pod selector matching works correctly
  • Tests: network policy parsing and matching

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3-lowPolish and quality of lifeenhancementNew feature or requestphase-4-polishEnterprise features and polish

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions