Skip to content

What a Kubernetes cluster made of browser tabs teaches us

Tabernetes turns browser tabs into Kubernetes nodes. It is a demo, but it shows what to design for when your nodes can vanish at any moment.

4 min read

Tabernetes is a small experiment that turns a browser tab into a Kubernetes node. You open a page, the cluster registers your device, and a pod runs inside a Linux kernel compiled to WebAssembly. Close the tab and the node disappears. It is a demo, not a product. Still, it shows clearly which parts of Kubernetes are fixed and which are open to change.

How the trick works

According to the project page, the tab opens a socket to an agent that sits beside the API server. The agent registers a Node object on the tab's behalf. When the scheduler places a pod there, the agent starts it through tabc, a container runtime built for browser tabs. The tab then boots Linux and runs the pod's program.

Three zones from top to bottom: a browser tab running Linux, the operator's server with an agent, API server and scheduler, and the tabc runtime. Arrows show the tab's socket to the agent and the agent registering the node.
The tab never talks to Kubernetes directly; the agent speaks for it.

The tab lends only CPU and memory. Storage and the pod's network identity are kept on the operator's server. The control plane is ordinary Kubernetes, and joining costs the visitor a download of about 5 MB and one CPU core, as the page describes it.

Note what is missing: the tab does not run a full node agent of its own. A server-side component speaks for it. This is a familiar pattern. Kubernetes does not care what a node really is, as long as something answers the API correctly.

One line decides where a pod runs

A pod asks for a tab with a single field, runtimeClassName: tab. Pods with that field go to tabs. Every other pod stays on the operator's own machines.

RuntimeClass is a standard Kubernetes feature. Teams use it to offer different ways of running containers in one cluster, for example a stricter sandbox for untrusted code. The practical lesson is that you can add a new kind of capacity without changing the shape of your applications. The cost is discipline. Use labels and taints so that a workload never lands on capacity it was not built for.

What disposable nodes force you to do

A tab can close at any second. That is an extreme version of what cloud teams already face with spot instances, autoscaling and rolling upgrades. If you can run on tabs, you can run on anything that comes and goes.

  • Let a controller own your pods. A bare pod is not recreated when its node dies. A Deployment or a Job is. The demo's promise that the pod restarts elsewhere depends on this kind of controller.
  • Keep state off the node. Anything worth keeping belongs in a store that outlives the machine running your code.
  • Make work retryable. A request that can be sent twice without harm is a request you can afford to lose once.
  • Cut work into small pieces. The demo draws a Mandelbrot image as 64 tiles, each computed by a different node. Small, independent tasks are easy to rerun when a node drops out.

The page also tracks two numbers separately: how long a tab takes to start a pod, and how long the cluster takes to answer a request. We like that habit. Startup time and request time fail in different ways, and a single average hides both.

Where it stops being a toy

There are good reasons not to put real workloads on visitors' browsers.

  • Trust runs both ways. The browser sandbox protects the visitor from the pod. Nothing protects you from a result computed on a device you do not control. For anything that matters you would need to check answers or compute them twice.
  • Resources are thin. One core, a phone that sleeps, a background tab that the browser may slow down. You cannot plan capacity around that.
  • No inbound connections. A browser cannot accept incoming traffic, so everything must pass through a server. That is why the address and the files stay server-side.
  • Latency is unpredictable. Home networks and mobile data are not a data center.

So the honest use cases are narrow: demos, teaching, volunteer computing, tests of how your system reacts when nodes vanish. Our own advice for production is simpler. Take the design lessons and leave the tabs.

The takeaway

Tabernetes is a clear reminder that Kubernetes is an interface before it is a set of servers. If your workloads are stateless, retryable and owned by a controller, losing a node is routine. Test that claim on purpose. Kill a node in a staging cluster, watch what breaks, and fix the part that was quietly relying on that machine staying alive.

Source: Hacker News