logoalt Hacker News

I ported Kubernetes to the browser

180 pointsby peterdeminyesterday at 8:48 PM63 commentsview on HN

https://github.com/ngrok/webernetes

https://webernetes-demo.ngrok.app/


Comments

dinklebergyesterday at 9:26 PM

This is cool. As someone who has authored Kubernetes educational content in a past role, I can definitely see the appeal of building something like this. iirc we first used Katacoda and then used some other similar platform and they were very useful since they spun up a fresh instance on the fly for each user with a specific setup.

Though it seems like right now this is probably better for conceptual/architectural education. The real fun is when you start learning to master kubectl.

show 2 replies
mintflowtoday at 3:14 AM

This is cool and impressive

Recently I also started to port fd.io vpp to rust for my app with help of codex

A clear interface and well defined test case is must to make the rewrite successful

raychisyesterday at 9:19 PM

First thing is first, this is really cool. 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 browser Kubernetes angle is cool, but what I find more interesting is the workflow, and especially testing behaviour against k8s instead of just trusting “looks right.” I do wonder how many teams are already doing this level of verification for AI-written code. It might be the direction everyone goes in over the next few years.

show 1 reply
duncanghyesterday at 8:57 PM

Investing early in this hn post before it’s a banger. Instant classic

show 2 replies
ewy1today at 1:28 AM

giving yourself (or your llm) infinite future work in maintaining all that duplicated kubernetes source code is a bad idea, surely? the author notes they could have compiled the kubernetes to wasm, but doesn't due to... bundle size? i haven't tried, but surely it wouldn't work because all os-level functionality would cause panics.

also the title is false

show 1 reply
playorizayayesterday at 11:32 PM

1. It's not really running containers in the browser, right? It seems every service would need a custom connector - and more importantly...

2. ...would need a renderer, right? Otherwise what does it mean to be "ported to the browser"?

To use an analogy - if somebody ported DOOM to the browser, that means I can now play it in the browser. But I can't really run those databases that it shows in the browser tab, can I?

I couldn't say spin up ruby2d and suddenly have client-side Ruby support. It would require all sorts of custom work to get that actually running in a browser tab.

Where presumably with typical backend container services they really can port around and run anywhere.

So I don't see the point, and someone correct me if I'm wrong but it doesn't even seem to be what it asserts.

show 1 reply
jaggederestyesterday at 9:16 PM

Perhaps to anticipate the multiple jokes about kube complexity, I think 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.

Kube rapidly becomes accidental complexity when you use it to accomplish things that could be done more simply, of course.

tekacsyesterday at 11:04 PM

First of all, this is wonderful stuff!

As a minor thought / question – I'm a little surprised that this isn't (yet) wired up for pods to run in Web workers.

I appreciate that there is a Clock mechanism (allowing you to step the cluster), which would be more difficult in that setup, but... I feel like especially with SharedArrayBuffer (which admittedly requires the right COOP/COEP), that could be pulled off with atomics.

Would be very cool to be able to actually thread in earnest with this design!

show 1 reply
ImJasonHyesterday at 10:50 PM

Relatedly, I vibecoded this a few days ago for fun: https://imjasonh.github.io/kubescheduler-the-game/

It was fun.

show 1 reply
mcapodiciyesterday at 9:46 PM

This is awesome. Wish I had the idea first. 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.

show 1 reply
stackskiptontoday at 12:38 AM

As SRE, Deployment, Replica Sets and Services are generally the easy part. The hard part which he noted:

>Right now, it doesn’t support ConfigMaps, Secrets, pod resources, persistent volumes, and a whole host of other things I haven’t needed yet. As I make more content with this library, I’ll implement more of what I need.

Yea, this is initial start to the madness followed by Ingress Controller and all little weird crazy stuff that Developers do that drive our lives crazy.

Also keeping these plates spinning while 100 devs are launching who knows what.

MPSimmonstoday at 12:55 AM

What are you using to replace etcd here? Where is state stored?

show 1 reply
postalratyesterday at 9:24 PM

wasm should be the "image" type for webernetes

sighansenyesterday at 9:06 PM

I wonder if stuff like this will also be created when token costs explode.

show 3 replies
artisinyesterday at 9:57 PM

There's even a blog/article write-up with a more succinct demo of Kubernetes: https://ngrok.com/blog/i-ported-kubernetes-to-the-browser

   > Is this just slop?
   > Almost all of the webernetes code was authored by LLMs
   > ...
   > I did two things that I think make this a slop-free project:
   > 1. I reviewed every line of code.
   > 2. I created hundreds of tests that assert webernetes behaves the same as a real cluster.
edit: added the slop-free remarks
malisperyesterday at 10:06 PM

A meta-trend I find interesting is there's a lot of projects using AI to rewrite existing systems in new programming languages. Most often in Rust.

  1. Bun rewritten in Rust
  2. Flow rewritten in Rust
  3. The react compiler was rewritten in Rust
  4. Grit is a new implementation of Git in Rust
  5. I've made my own rust rewrite of postgres that passes 100% of the regression and isolation tests[0][1]
I think AI changed the economics of these projects even more than it has the economics for software engineering work in general. Though direct AI code translation is usually slop for me.

One of the many things I did to deal with this was an audit skill that would:

  1. Find a small chunk of code to rewrite
  2. Have a list of things that it was looking for in each piece of code that's being rewritten
  3. Place that next to the code being translated
  4. If that document didn't exist and/or didn't say the code was passing the audit, code wouldn't be merged
  5. As I found problems and anti-patterns I would add those to the skill over time
This by itself still let a lot of slop slip through, but also preemptively caught a ton of issues as part of my overall process.

Complicated old "boring" infra software might actually be the most AI-rewriteable code right now

[0] https://pgrust.com

[1] https://github.com/malisper/pgrust

show 2 replies
doctobogganyesterday at 9:11 PM

Interesting project and (possibly more) interesting explanation of the development process. I agree with the author that the primary difference between vibe slop and real engineering is just reading the lines of code. However it does feel like we are just on the cusp of only needing to read the tests and _not_ all the lines of code. Maybe a few more model generations and we will be there.

show 1 reply
ianeffyesterday at 9:30 PM

This is great!

frizlabyesterday at 10:04 PM

And now for a fun game with this: try and delete all the pods!

TZubiriyesterday at 11:45 PM

https://xkcd.com/763/

>I'll often encourage BACKEND JAVASCRIPT DEVS to try to solve computer problems themselves by trial and error.

>However I've learned an important lesson: if they say the've sold their problem, never ask how.

syngrog66yesterday at 10:47 PM

"Just because one can do a thing does not mean one should do that thing."

rvztoday at 1:31 AM

A new low in AI slop.

shizuhalabsaitoday at 3:33 AM

[flagged]

tosieftoday at 12:20 AM

[dead]

bogotayesterday at 9:07 PM

[dead]

lstoddyesterday at 9:07 PM

Please port Kubernetes to common house flies so that they drop dead out of all the unnecessary overhead. That would be helpful.

show 1 reply