DEV Community

Cover image for I Built a Kubernetes IDE in Rust + Swift Because Lens Was Eating My RAM
chonle
chonle

Posted on

I Built a Kubernetes IDE in Rust + Swift Because Lens Was Eating My RAM

I manage clusters with 1,700+ pods daily. Lens was using 1.5 GB of RAM and taking 30 seconds to start. k9s was fast but I missed having a GUI for log viewing and resource inspection. So I built Krust — a native Kubernetes IDE written in Rust and Swift.

The Problem

Every Kubernetes GUI I tried had the same issue: Electron.

Bundling an entire Chromium browser to display a table of pods is overkill. The result is slow startup, high memory usage, and a UI that never quite feels native. On the other hand, terminal tools like k9s are fast but limited - no multi-pod log aggregation, no visual diffing, no drag-and-drop topology graphs.

I wanted something in between: GUI workflows with terminal performance.

The Architecture

┌─────────────────────────────┐
│   Swift / SwiftUI / AppKit  │  ← Native macOS UI
├─────────────────────────────┤
│        UniFFI Bridge        │  ← Zero-copy FFI
├─────────────────────────────┤
│      Rust Core (kube-rs)    │  ← All K8s logic
└─────────────────────────────┘
Enter fullscreen mode Exit fullscreen mode

Rust handles everything Kubernetes: watch streams, data filtering, sorting, metrics aggregation, and YAML parsing. The Swift layer only does rendering.

Key design decisions:

  • Compact data model: ~700 bytes per pod vs ~70 KB for raw K8s objects. This is why 1,700 pods fit in 200 MB.
  • NSTableView for large tables: Only renders the ~30 visible rows. SwiftUI's List re-renders everything — NSTableView doesn't.
  • HTTP/2 multiplexing: One connection per cluster handles all resource watchers simultaneously.
  • No garbage collector: Rust's ownership model means predictable memory usage with no GC pauses.

Benchmarks (1,700 pods, production cluster)

Metric Krust k9s Lens
Memory ~200 MB ~600 MB 1.5 GB
Startup <1s ~3s 5-30s
Threads 15 55
App size 26 MB

What It Does

27+ resource types with real-time watchers — Pods, Deployments, StatefulSets, DaemonSets, Jobs, CronJobs, HPAs, Services, Ingresses, ConfigMaps, Secrets, Nodes, PVs, PVCs, Helm releases, CRDs, and more.

Log Viewer

This was the feature I built for myself first. 100K line ring buffer with <15ms full-text search. JSON logs get auto-parsed and compacted. Multi-pod aggregation lets you tail logs from an entire deployment at once.

Terminal

Built on SwiftTerm — a native terminal emulator with real TTY support. Auto-detects the right shell (bashashsh) so it works on Alpine and Busybox containers without configuration.

Cross-Cluster Diff

Select any two resources from different clusters, see a side-by-side diff with Myers algorithm. Useful for comparing staging vs production configs.

Helm Management

List releases, view history, inspect values, rollback to any revision, upgrade with value preview. No helm CLI needed — Krust talks directly to the Tiller/Helm storage.

Security Audit

31 built-in security checks + Trivy CVE scanning. Export results as SARIF. This is free — Lens charges $30/mo for similar functionality.

AI Diagnostic Agent

Built-in AI agent with 11 Kubernetes tools. Right-click a pod → "Explain with AI" and it inspects logs, events, and resource state to diagnose issues. Supports Claude, GPT, Gemini, Vertex AI, or local Ollama. BYOK — your API key, your machine, zero data leaves.

Resource Topology

ArgoCD-style interactive graph showing Deployment → ReplicaSet → Pod → Service → Endpoints relationships. Drag nodes, expand/collapse, see the full picture.

Smart Filter Syntax

Instead of multiple dropdowns, Krust has a single search bar with typed filters:

status:crash ns:prod cpu>80
Enter fullscreen mode Exit fullscreen mode

smart filter

This finds crashing pods in the prod namespace using more than 80% CPU. Works across all resource types.

Keyboard-First

Coming from k9s, I needed keyboard shortcuts. Krust supports:

  • Cmd+K — Command palette
  • S — Shell into selected pod
  • L — View logs
  • E — Edit YAML
  • D — Delete
  • / — Focus search

Command palette

Single-key shortcuts work when no text field is focused, just like k9s.

Zero Telemetry

Krust connects only to your Kubernetes API server. No analytics, no cloud accounts, no phone-home. Your kubeconfig stays on your machine.

Pricing

Free forever: All 27 resource types, logs (single pod), terminal, port forwarding, YAML editor, Helm management, security audit, metrics, multi-cluster.

Pro ($9/mo): Multi-pod log aggregation, structured log parsing (JSON/logfmt), AI agent, topology graph, priority support.

30-day trial with no sign-up required.

Install

brew install slarops/tap/krust
Enter fullscreen mode Exit fullscreen mode

Or download the DMG from GitHub Releases.

Currently macOS 15+ (Apple Silicon and Intel). Windows and Linux are coming in April 2026.

What I Learned Building This

  1. UniFFI is production-ready. Mozilla's FFI generator for Rust → Swift/Kotlin/Python works well. The generated bindings are clean and the type mapping is predictable.

  2. NSTableView still beats SwiftUI for large datasets. SwiftUI's Table re-renders the entire view on data changes. NSTableView only touches visible rows. For 1,700+ rows with real-time updates, this matters.

  3. HTTP/2 multiplexing is underused. Most K8s tools open separate connections per resource watcher. A single HTTP/2 connection can multiplex all of them, reducing connection overhead and file descriptor usage.

  4. Compact data models compound. Storing 700 bytes per pod instead of 70 KB means 100x less memory, but also faster sorting, filtering, and serialization across the FFI boundary.


If you manage Kubernetes clusters and want a GUI that doesn't tax your system, give Krust a try. I'm actively developing it and would love feedback.

Website: krust.io

Top comments (0)