kith (n.) one's close circle; the people you trust.
All of your machines, one cluster.
kith is a tiny, immutable operating system and one small daemon. It joins your machines into a cluster and keeps them matching the YAML you apply: containers, virtual machines, storage, DNS, and the network between them.
Run it on one machine Read the guide
Version 1.0.0. No release is tagged yet: it is built from source.
$ kith apply -f hello.yamlhello: 7 of 7 replicas ready, on 4 machinesShown faster than life: a lost machine's replicas start elsewhere only after --lost-after, five minutes unless you say otherwise.kithd: the store, the scheduler and the runtime in one static binary
of memory held by kithd with nothing to do, its binary read from disk
a whole kith OS update: kernel, root and its hash tree
built-in kinds of resource, all in one strict schema
01 Apply
Say what should run. Apply it.
Every resource is the same shape of YAML. kith lint checks files with no daemon, kith diff says what would change, and kith apply is all or nothing. Each change is a revision, and kith rollback goes back to one. What you wrote for Kubernetes works as it is: kithd answers kubectl and helm for Deployments, StatefulSets, Jobs, Services and the rest of the core kinds, and nothing of Kubernetes runs behind it.
apiVersion: kith.dev/v1 kind: Workload metadata: name: hello spec: template: containers: - name: main image: mirror.gcr.io/library/busybox:1.36 command: - sh - -c - while true; do echo hello; sleep 5; done resources: memory: 32Mi cpu: 100m
$ kith apply -f hello.yaml Workload/default/hello created (revision 1) $ kith get KIND NAMESPACE NAME REVISION STATUS Workload default hello 1 1/1 ready $ kith lint -f web.yaml web.yaml:7:13: invalid type: string "yes", expected u32 | replicas: yes | ^
02 Cluster
Three machines, and one can go.
One command on the first machine, a token, one command on each of the others. There is no separate control plane to install: every node is the same kithd.
- webon alpha, beta and gamma
- leadergamma
- Every node keeps the whole store. A change is on the disks of more than half of the voting nodes before it is answered.
- Lose the leader and the other two pick a new one within a few seconds.
- The nodes find each other over a WireGuard mesh that
kithdsets up itself: directly where they can, through an edge node where they cannot. - Tested by breaking it. The chaos test cuts off and resets every node in turn, then all three at once. Every write that was acknowledged is on all three afterwards.
- Shown faster than life: a silent node reads
unreachableafter ten seconds, and its replicas still count as ready until it has been gone for--lost-after(five minutes unless you say otherwise); then they start elsewhere.
03 kith OS
An operating system with nothing to log into.
kithd is the machine's first process. The root is 6.2 MB, read-only, and checked block by block as it is read. There is no shell, no libc and no package manager. A node runs from one slot and updates into the other, so the system that runs is never the one being changed.
- Written and checked. Each piece of a signed update is held to the SHA-256 in its header as it lands in the other slot.
- Three tries. The node restarts into the new slot, and the boot loader counts each start.
- Good after ten seconds. A slot whose
kithdis still running then is kept. - Otherwise, back. When the tries are gone the slot that worked starts again, and says so.
Updates are signed, and a node takes none older than the newest it has run well. A release can hand its keys over to new ones. An UpdatePlan rolls a release through the cluster, one node at a time unless you say more.
- A spec.
features: [gpu-amd-phoenix]: a feature is named, with no file names and no versions. - Compiled in.
os/build.sh --specbuilds its kernel config and the firmware its driver loads into the kernel. - A selector. Each image is signed as its own
OSRelease, and anUpdatePlanwith aselectorrolls it to the nodes that carry a label. - Rolled out. Those nodes update into their other slot, as above.
04 Hardware
A GPU to share. A seat for a desktop.
Hardware is a resource like the rest: a Device a workload claims, and a Seat that holds a screen, a keyboard and a GPU together. What a workload may take is written in its YAML, and a claim that does not fit waits and says why.
Each claim says share: { vram: 512Mi } or more. Shares add up, and the one that does not fit waits: its message gives the numbers.
- A share is a ceiling where the driver gives the kernel's
dmemcgroup a region (amdgpu, xe, NVIDIA's). Each container gets the sum of its shares asdmem.max, and the claim's status saysenforced: true. - Where kithd cannot hand the controller down (it is not root) there is no ceiling, and the status says
enforced: false. A share is then a promise between workloads. - A seat is given to a namespace by a label. A session that claims it takes its screen, keyboard and GPU, and no other workload can.
A desktop is a package.
kith has no desktop of its own: a node nobody gives one stays headless. A package renders a session that holds a seat, and deleting the release makes the node headless again. kith ships no desktop images: you name one you built or trust.
On a seat
A screen on the machinegnomehyprlandkioskkith-panel
In a browser
No screen neededselkies
$ kith package render packages/hyprland \
--name office -n desktop \
--set seat=SEAT --set image=IMAGE \
| kith apply -f -
Selkies is a desktop in a browser: a pod behind a Service on port 8080, and its login is the password of a Secret you make first. On a spare kith OS PC it answered 401 without the password, and 200 with it.
05 Build
Test on the cluster you are building.
The tests of a pushed commit can run on another kith node, as a Job there, in a pod, as a user that is not root. ci/remote.sh prints what failed and how long it took, and exits as cargo test did.
$ KITH_REMOTE=ADDR \
KITH_REMOTE_CREDS=DIR \
sh ci/remote.sh
- your commit
- a Job on a node
- cargo test, in a pod
- what failed, and the time
218s
The whole workspace, from a fresh clone. One test, node_policy_refuses_what_the_node_turned_off, timed out in the pod: it differs there.
06 Numbers
Small, and held to it.
Four budgets are measured by ci/budgets.py, and a build that goes over one fails. Every figure on this page is measured the same way and written here by a script: none is typed in.
Beside k3s
What it does not say: anything about many nodes, hundreds of workloads, or work heavier than a small web server. And the two are not the same thing: k3s is Kubernetes, with its whole API and all that is written for it; kith answers the part kubectl and helm use for the core kinds and refuses the rest by name. How it was measured, and every run.
Where the code is
tests in the tree
more that boot whole machines in QEMU
lines of Rust, with unsafe forbidden outside one small crate
crates in one workspace
07 Kinds
38 kinds, one way to say them.
What runs, where its data lives, who may change it, and the machines themselves are all resources. You can define kinds of your own, with controllers and admission in WebAssembly. They are written in YAML, or in kith's own small language: a .kith file has names, functions and imports, gives the same resources, and is checked against the same schemas. Every node serves a web page with a form for each of them, drawn from its schema.
Run
Containers, plain processes and virtual machinesWorkloadNodeWorkloadJobCronJob
Reach
Names, load balancing, ingress with ACME, a DNS serverServiceDNSZoneDNSRecordDNSBlockListNetworkPolicy
Tunnels
A WireGuard way out for pods, and what a person's device reachesExitAccessLevelRemotePeer
Keep
Replicated and encrypted volumes, backups to S3, sharesVolumeVolumeClaimBlobBackupImageShare
Configure
Delivered as files or environmentSecretConfigMap
Hardware
GPUs, displays and input, claimed by a workloadSeatDeviceDeviceClaim
Package
Signed packages in OCI registries, and GitOpsPackageReleaseRepositorySource
The machines
Nodes, their OS releases and rolloutsClusterNodeNamespaceOSReleaseUpdatePlanNodeKey
Access
Who may do what, by kind, verb and namespaceIdentityRoleRoleBinding
From Kubernetes
What kubectl and helm send that kith keeps as sent and does not act onKubeObject
Your own
New kinds with a schema, served like the built-in onesKindDefinition
Three nodes on one machine, photographed by ci/ui_shots.py. A form for every kind, drawn from its schema; an apply shows its diff first.
08 Security
Kept small, and said plainly.
A container is kept from most of the machine
It runs as a user that is not root, with no capabilities (on kith OS, only the one to take a port below 1024) and no new privileges, on a read-only image, behind a filter that refuses 40 system calls. A template has to say so to take any of that off.
Only signed things are taken
Packages and OS releases are refused without a signature by a key the cluster trusts. (An update stick is not signed: whoever is at the machine with one is its admin.) An image is held to a signature when its template names keys.
What is not defended is written down
Who is trusted with what, every gap that is known, and what was never reviewed: it is all in one file, and it does not flatter. Read SECURITY.md
What a container may not ask the kernel for, as the filter names them:
09 Start
One machine is enough to begin.
kithd runs as you, with no root, on a Linux you already have. kith OS and more machines can come later.
$ cargo build --release $ export PATH=$PWD/target/release:$PATH $ systemd-run --user --scope --quiet kithd & $ kith apply -f examples/hello.yaml $ kith get -w workload $ kith logs workload/hello -f
$ kithd --listen 192.0.2.10:7443 --name alpha $ kith node token # on the other machine $ kithd --join 192.0.2.10:7443 --token TOKEN --name beta $ kith get node
The README has the rest Install kith OS The guide The design
10 Install
Answer once. It installs without asking.
The kith OS installer asks at the machine's console: which disk, what name, what address, which cluster. Answer on the install page instead, and it writes kith-install.yaml for the stick, in your browser. The machine then asks nothing.
- The stick Write the installer to a USB stick. Everything on it is lost.
- The disk Which one is erased: the machine's only disk, or one by its name or its serial.
- The name What the machine is called. Left empty, it names itself from its network card's address.
- The network Ask the network, or give it a fixed address, a way out and a DNS server.
- The cluster Start one, or join one with the address of a node and a token.
- Encryption Whether its state is locked. If it is, a recovery key is shown once.
- What it accepts The release key it takes updates from, and what the cluster may have it do.
- Writing The file goes on the stick, or is fetched from a URL by its digest.
- The key Written down when it appears on the console: it is shown that once.