RC RANDOM CHAOS

Webernetes: a partial Kubernetes port that runs a live cluster in your browser

· via Hacker News

Original source

I ported Kubernetes to the browser

Hacker News →

ngrok’s Sam Rose has released webernetes, a partial reimplementation of Kubernetes in TypeScript that runs entirely client-side in a browser. Rather than compiling Go to WebAssembly — which he rejected because a trivial Go ‘hello world’ already gzips larger than his whole project — he ported the pieces that matter: a stripped-down kubelet, several controllers (scheduler, namespace, kube-proxy, deployment), a simulated CNI for pod-to-pod networking, and a browser-native container runtime the kubelet drives over the CRI. The result is roughly 100,000 lines across 629 files, built in two months, that genuinely handles pod lifecycles, cluster DNS, IP allocation, and Deployment/ReplicaSet tracking at about 140KiB gzipped. Images aren’t pulled from a registry; you define them with a TypeScript API and apply standard-looking manifests through a Kubernetes-style API surface.

The project isn’t meant to be a production distribution — it’s a teaching tool for building interactive Kubernetes content, and it still lacks ConfigMaps, Secrets, persistent volumes, and pod resource limits. The more pointed story is the engineering process: nearly all the code was written by LLMs, and Rose is upfront that this invites accusations of ‘slop.’ His defense is twofold — he reviewed every line to confirm it maps closely to the upstream Go source, and he wrote hundreds of tests asserting webernetes behaves like a real cluster.

The most useful takeaway for practitioners is his account of where LLMs failed at porting. They took shortcuts (swapping Kubernetes’ specialized caches — LRU, expiring, FIFO — for a plain Map, producing wrong behavior), ‘helpfully’ invented helper functions absent from the original that introduced subtle drift and made side-by-side review harder, and silently dropped test cases when translating Go table tests. Unlike high-profile LLM porting efforts (Anthropic’s C compiler, Bun’s Zig-to-Rust move) that had trusted oracles to check against, Rose had to build his own correctness harness from scratch — a reminder that LLM-assisted porting is only as trustworthy as the verification wrapped around it.

Read the full article

Continue reading at Hacker News →

This is an AI-generated summary. Read the original for the full story.