Tabernetes:节点为浏览器标签页的 Kubernetes 集群
Tabernetes: A Kubernetes cluster whose nodes are browser tabs

原始链接: https://tabernet.es/

Tabernetes 将浏览器标签页变成 Kubernetes 节点。标签页加入时,下载约 5 MB,并在一个核心上运行小型 Linux 客户机,直到关闭;关闭后移除该节点,Kubernetes 会将其 Pod 重新调度到别处。控制平面位于中心,每个标签页一个节点,Services 将请求路由到 Pod。用户可以向 Services 发送请求,或渲染被分成 64 个瓦片的 Mandelbrot 图像,每个瓦片由标签页的 Pod 使用 awk 计算;瓦片会显示渲染它的设备。加入通过 API 服务器旁的代理完成,该代理将标签页注册为 Node,然后调度器使用 tabc(一种面向浏览器标签页的容器运行时)部署 Pod。标签页启动 WebAssembly 编译的 Linux 内核,而 Pod 文件和地址保留在集群机器上。除了 Pod 规范中的 `runtimeClassName: tab`,它就是普通 Kubernetes。指标跟踪启动时间和请求延迟,尽管最初尚未有任何记录。

一篇 Hacker News 帖子,标题为“Tabernetes:一个节点为浏览器标签页的 Kubernetes 集群”,获得了 10 点和三条评论。一位评论者对如何识别自己的节点以及浏览器标签页如何协调 pod 感到困惑,但仍然称这个想法令人印象深刻。另一位开玩笑说魁北克开发者可能会被这个名字逗乐。第三位称赞了 unkernel.dev,并好奇人们可能用它构建哪些有用的应用。
相关文章

原文
tabernetes: a Kubernetes cluster whose nodes are browser tabs
tabernetes

Open the page and your phone is a node. The scheduler sends it a pod, and the pod's program runs on a Linux kernel booted in the tab. Close the tab and the node is gone, and Kubernetes starts the pod on someone else's.

A QR code for the page that makes a browser a node

Scan to become a node, or use the browser you are reading this in.

Join the cluster

Joining downloads about 5 MB and runs a small Linux guest in the tab, on one core, until you close the tab.

0

pods moved off a closed tab

0

carried between tabs and the machine

Topology

The control plane in the middle, a node for each tab, and each Service on the way to the pods behind it. A node is filled when its pod is running. An orange dot is a request you sent, on its way to the pod that answered, and a green one is a tile of the picture on its way to the node that rendered it.

Boot time

How long a tab takes to start its pod: from the tab being handed the pod to the pod's program running, which is the page loading, the kernel booting and the image being mounted. The last 0 starts.

No pod has started yet.

Happening now

Nothing yet. A tab that joins shows up here.

The fleet

What the nodes are, by what their browsers say.

The nodes

No tab is a node right now. Yours can be the first.

How it works

  1. A tab joins. The join page holds a socket open to an agent beside the API server, and the agent registers a Node for the tab.
  2. The scheduler sends a pod. The agent starts the pod's container with tabc, a container runtime whose containers run in browser tabs.
  3. The tab boots Linux. A kernel compiled to WebAssembly runs the pod's program on the tab's CPU and memory. The pod's files and its address stay on the cluster's machine.

A pod asks for a tab in one line

The control plane is an ordinary Kubernetes, and a pod is an ordinary pod. The marked line is the only one that is new: the scheduler puts a pod that has it on a tab, and every other pod on the cluster's own machine.

apiVersion: v1
kind: Pod
metadata:
  name: hello
spec:
  runtimeClassName: tab
  containers:
    - name: hello
      image: alpine
      command: ["sh", "-c", "echo hello from $(uname -m) in a tab; sleep 3600"]
联系我们 contact @ memedata.com