Webernetes: Kubernetes Ported to the Browser in TypeScript

TL;DR
Ngrok engineer Sam Rose ported 100,000 lines of Kubernetes to TypeScript, creating a browser-based cluster for educational use - with 2,059 tests proving it behaves like real k8s.
Sam Rose, a Senior Developer Educator at ngrok, spent two months porting Kubernetes to TypeScript to run entirely in the browser. The result is Webernetes - 100,000 lines of code across 629 files, weighing in at 140KB gzipped.
The project is not for running production workloads. It is for teaching how Kubernetes works.
What Was Actually Ported#
Rather than compiling the Go codebase to WebAssembly (which would have blown past 500KB), Rose rewrote key components:
- Kubelet functionality - Pod lifecycle management and probing
- Controllers - Pod scheduler, namespace controller, kube-proxy, deployment controller
- Container Runtime Interface (CRI) - Browser-based container execution
- Container Network Interface (CNI) - Simulated network for pod-to-pod communication
- Cluster API - TypeScript interface for applying manifests and watching resources
What is not included: ConfigMaps, Secrets, pod resource limits, persistent volumes, and real container image support. The registry is browser-only.
Custom Image Format#
Since Docker Hub images cannot run in a browser, Webernetes uses a TypeScript API for defining container images with built-in HTTP server capabilities:
const myContainer = new WebContainer({
image: 'my-app',
ports: [8080],
start: async (ctx) => {
ctx.serve(8080, (req) => new Response('Hello from Webernetes'));
}
});
This is enough to demonstrate pod-to-pod networking, deployments, and service discovery without real container runtimes.
The Test Suite#
The legitimacy check for any port is whether it actually behaves like the original. Rose addressed this with two test layers:
- 204 integration tests comparing behavior against real k3s clusters using identical APIs
- 1,855 unit tests ported from the Kubernetes Go codebase
Both suites run against webernetes and k3s, asserting the same behavior.
The LLM Development Story#
The blog post is upfront about methodology:
Almost all of the webernetes code was authored by LLMs.
Rose argues this is not slop because of two practices:
- Every line was reviewed. LLM output was treated as draft code, not final.
- Behavior tests against real clusters. The tests do not just check "does it compile" - they check "does it match what k3s does."
This framing - AI generates, human reviews, tests verify against ground truth - is one model for using AI coding tools responsibly in larger projects.
What HN Is Saying#
The Hacker News discussion was generally positive, with interest in both the project and the development process.
On the project itself, one commenter noted: "I see this as a fun learning and experimental tool. For a while I have wanted to make a web page where you can do service load balancing and queuing simulations so this would be a great basis for it."
Others appreciated the educational angle: "As someone who has authored Kubernetes educational content in a past role, I can definitely see the appeal of building something like this."
On the AI development process, one commenter observed: "This feels like the right way to frame LLM-assisted engineering. AI can generate a shocking amount of code, but the actual value is in the review discipline, and tests around it."
The complexity question came up predictably, with jokes about Kubernetes overhead. But one commenter made a more nuanced point: "There's an interesting argument to make that something like kube is the necessary complexity level for the kinds of tasks that kube is intended to accomplish, ala Fred Brooks' rule about essential complexity vs accidental complexity."
Use Cases#
The demo at webernetes-demo.ngrok.app lets you interact with a cluster in your browser. Practical applications include:
- Interactive tutorials - No cloud credits or local setup required
- Conceptual demonstrations - Show how pods, services, and deployments interact
- Sandbox experimentation - Try kubectl commands without consequences
- Educational content - Embed working clusters in documentation
It is explicitly not for cluster operations, production workloads, or anything requiring real container images.
Technical Details#
| Metric | Value |
|---|---|
| Lines of code | ~100,000 |
| Files | 629 |
| Gzipped size | ~140KB |
| Unit tests | 1,855 |
| Integration tests | 204 |
| Development time | 2 months (April-June 2026) |
| License | Open source (ngrok) |
The Broader Point#
Webernetes is interesting on two levels:
-
As an educational tool - It solves the "I need a cluster to teach Kubernetes" problem without requiring cloud infrastructure.
-
As an AI development case study - The combination of LLM code generation, human review, and behavioral testing against ground truth is a pattern worth studying.
The project ships with documentation on how to extend it with custom controllers and workloads, making it useful for anyone building Kubernetes educational content.
Continue Reading#
- Three Ways to Ignore Files in Git (Beyond .gitignore)
- GitHub Copilot Agent Finder: What ARD Means for Third-Party AI Tools in 2026
- GitHub Copilot CLI, BYOK, and AI Credits: The New Cost-Control Stack
Sources#
- Webernetes GitHub Repository - Source code and documentation
- Blog Post: I Ported Kubernetes to the Browser - Full technical writeup by Sam Rose
- Webernetes Demo - Interactive browser demo
- Hacker News Discussion - Community discussion with 80+ comments
Last updated: July 1, 2026
Get the next deep dive like this in your inbox
One email a week on News and the rest of the AI dev stack. Free.
Read next on AI coding tools
TypeScript 7 Is Here: The Native Go Port Delivers 10x Faster Builds
Microsoft ships TypeScript 7.0 with a complete Go rewrite of the compiler, delivering 8-12x build speedups and transforming IDE responsiveness across massive codebases.
6 min readScriptc by Vercel: TypeScript-to-Native Compiler With No JavaScript Engine
Vercel Labs released Scriptc, a TypeScript-to-native compiler that produces self-contained binaries of 170-200KB with ~2ms startup times and no embedded JavaScript engine. The HN community is sharply divided on whether this is a genuine engineering breakthrough or another Vercel Labs project that will be abandoned in months.
9 min readGleam Moves to Tangled: What the ATProto Code Forge Means for Developers
The Gleam programming language has migrated to Tangled, a new ATProto-based code hosting platform. Here's what this means for developers and the future of decentralized forges.
6 min readNew here? Start with
Technical content at the intersection of AI and development. Building with AI agents, Claude Code, and modern dev tools - then showing you exactly how it works.








