Skip to content

Repository files navigation

Barenetes

A minimal Kubernetes implementation written in Rust

Rust License: MIT Issues PRs Welcome GitHub Stars


Barenetes is an open-source, reimplementation of the core Kubernetes control plane in Rust. The goal is to build a working, minimal container orchestrator from scratch.

Status: Early development. Core components are being scaffolded. Not production-ready.


Table of Contents


Overview

Kubernetes is a powerful but complex system. Barenetes strips it down to its essential primitives, reimplementing them in safe, idiomatic Rust. The project is designed to be readable and approachable.

Key design principles:

  • Minimal : only the core orchestration loop, no optional features
  • Transparent : clear separation between components, explicit communication via gRPC
  • Safe : Rust's type system and ownership model enforced throughout

Architecture

Barenetes architecture overview

Components

Barenetes is a Cargo workspace composed of six crates, each mirroring a real Kubernetes component (pki has no direct equivalent; it's the cluster's own mTLS bootstrap tool). All inter-component communication uses gRPC / Protocol Buffers, secured with mutual TLS.

Crate Equivalent Role
agent kubelet Runs on each node, manages container lifecycle
api kube-apiserver Central hub : accepts requests and coordinates state
barectl kubectl CLI to interact with the API server
scheduler/reconciliator kube-scheduler Assigns workloads to nodes
cni CNI plugin Manages pod networking
pki - Bootstraps the cluster's private mTLS CA and certs

Proto definitions live in proto/<component>/v1/.


Getting Started

Prerequisites

  • Rust (edition 2026 / nightly)
  • protoc : Protocol Buffer compiler

Clone

git clone https://github.com/do-2k25-28/Barenetes.git
cd Barenetes

Building

Build the entire workspace:

cargo build

Build a single component:

cargo build -p agent
cargo build -p api
cargo build -p barectl
cargo build -p scheduler
cargo build -p cni
cargo build -p pki

Run a component:

cargo run -p api

Deploying

Every tagged release (vX.Y.Z) publishes all six binaries as GitHub Release assets. deploy/install.sh installs them as systemd services on a control plane and/or worker node, and always sets up a private mTLS CA for the control plane's own services:

sudo ./deploy/install.sh --role control-plane                        # api + scheduler, mTLS by default
sudo ./deploy/install.sh --role worker --server https://<cp-ip>:50052 --node-name <name>   # cni + agent
sudo ./deploy/install.sh --role all --node-name <name>                # single-node setup

The barectl CLI is also published as a .deb, a .rpm, and a pacman .pkg.tar.zst on each release, so it can be installed directly on Debian/Ubuntu, Fedora/RHEL-family, and Arch-family distros. These packages include shell completions for Bash, Zsh, and Fish:

# Debian / Ubuntu
sudo apt install ./barenetes-barectl_*.deb
# Fedora / RHEL / Rocky / AlmaLinux
sudo dnf install ./barenetes-barectl-*.rpm
# Arch / Manjaro / EndeavourOS
sudo pacman -U ./barenetes-barectl-*.pkg.tar.zst

See deploy/README.md for options (etcd, multi-node CNI overlay, mTLS/PKI, etc.) and current limitations.


Contributing

Contributions are welcome. Please open an issue before submitting a pull request for non-trivial changes so we can discuss the approach first.

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/my-feature)
  3. Commit your changes
  4. Open a pull request

Please keep PRs focused : one feature or fix per PR.


License

Distributed under the MIT License. See LICENSE for details.


Star History

Star History Chart

About

⚓ Open-source minimal container orchestration project, written in Rust.

Topics

Resources

Contributing

Stars

14 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages