krabkube 0.2.2

Lightweight kubelet and Kubernetes-compatible runtime for 1 GB machines (krab binary)
krabkube-0.2.2 is not a library.

krab

A 6 MiB kubelet for real Kubernetes. One static Rust binary turns a 1 GB machine into a worker node of k3s or kubeadm (1.30 to 1.34). A whole node with 20 pods takes 42 MiB instead of 268 MiB.

crates.io release license

memory of a whole worker node, krab vs k3s

Worker node, 20 busybox pods krab agent k3s agent
node memory (cgroup memory.current) 42.3 MiB 267.5 MiB
node anonymous memory 9.8 MiB 204.1 MiB
idle node memory 12.2 MiB 94.4 MiB
agent process RSS, idle / 20 pods 5 to 6 / 7 to 9 MiB kubelet + kube-proxy + flannel: 61 / 73 MiB
binary 6 MiB 200 MiB

krab node = agent + WireGuard + ClusterIP + DNS + youki shims + pods. k3s node = kubelet + kube-proxy + flannel + containerd + shims + pods, same method, same host, bench/RESULTS.md. The same agent measured 4.9 / 6.5 MiB on arm64 and 5.1 / 6.8 MiB on a real 1 GB VM; a 30-minute soak with a rollout every minute stays at 3.7 to 4.0 MiB after the allocator trims (growth under churn is about 13 KiB per rollout, being tracked).

Install

brew install telotonet/tap/krab        # Linux; or: cargo install krabkube, or the release tarball
# on the worker, token from `kubeadm token create --print-join-command`
sudo KRAB_VERSION=v0.2.2 sh deploy/install.sh
sudoedit /etc/krab/agent.env                         # server, ca hash, node name
sudo sh -c 'umask 077; cat > /etc/krab/join-token'
sudo systemctl enable --now krab-agent
kubectl get nodes -o wide                            # Ready, runtime krab-native://

Requirements, RBAC and k3s notes: docs/AGENT.md.

What works

  • Join: bootstrap token + CA hash, node client certificate by CSR, automatic rotation.
  • Pods: init containers, restart policies, liveness/readiness/startup probes, postStart/preStop hooks, activeDeadlineSeconds, env (fieldRef, resourceFieldRef, ConfigMap, Secret), emptyDir, hostPath (allow list), ConfigMap, Secret, projected, downwardAPI, local-path PVC, ServiceAccount tokens, live ConfigMap/Secret updates, terminationMessagePath.
  • kubectl: logs, exec, attach, port-forward, top (real metrics-server).
  • Network: pod CIDR from the node, WireGuard between krab nodes, ClusterIP via nftables, cluster DNS.
  • Node health: real Memory/Disk/PID pressure, eviction (BestEffort first), unused image GC.
  • Isolation: youki with a default seccomp profile, no privileged or host-network pods, node authorizer, SubjectAccessReview on the kubelet API.

Compatibility

Control plane Tested
k3s 1.34 agent suite, join with rotation, kubectl top, two-node networking
kubeadm 1.30 to 1.34 containerd node next to a krab node: join, Deployment on both, logs, exec

bench/node-checks.sh: 35 sig-node behaviour checks, all pass. CI runs the full matrix nightly and on tags.

Limitations

Beta. Not CNCF-certified. On kubeadm 1.34, 139 of 166 [NodeConformance] specs passed in the last full run; the rest are unsupported features (privileged, hostNetwork, ephemeral containers, websockets, hook host) or need external storage. Worker role only, Linux, IPv4. No CSI, NetworkPolicy, hostNetwork or privileged pods. The kubelet-serving CSR needs an admin approval, as with kubelet serverTLSBootstrap. Eviction and image GC have unit tests but no load test yet. No HA control plane tests. No third-party security audit; an internal review left no open critical or high findings.

Standalone mode

krab serve also runs a tiny Kubernetes-compatible API server on a single machine (about 4 MiB). Experimental and paused; the agent is the supported way to use krab.

Development

cargo fmt --all --check && cargo clippy --workspace --all-targets -- -D warnings && cargo test --workspace

License

MIT.