A lightweight Kubernetes-compatible container orchestration system written in Rust, implementing the Container Runtime Interface (CRI) with support for single c
A lightweight Kubernetes-compatible container orchestration system written in Rust, implementing the Container Runtime Interface (CRI) with support for single c
rk8s is a lightweight, Kubernetes-compatible container orchestration system built on top of Youki, implementing the Container Runtime Interface (CRI) with support for three primary workload types: single containers, Kubernetes-style pods, and Docker Compose-style multi-container applications.
The rk8s project is initiated by the Web3 Infrastructure Foundation and developed with support from Associate Professor Feng Yang’s lab at Nanjing University and the Institute of Software Chinese Academy of Sciences, through the R2CN.
The project is currently in WIP stage and should not be used in production environments.
rk8s follows a distributed architecture with both standalone and cluster deployment modes:
Manage standalone containers with resource limits and port mappings:
Example single container specification:
name: single-container-test
image: ./rk8s/project/test/bundles/busybox
ports:
- containerPort: 80
protocol: ""
hostPort: 0
hostIP: ""
args:
- sleep
- "100"
resources:
limits:
cpu: 500m
memory: 233MiGroup multiple containers sharing the same network namespace and lifecycle, implementing the Kubernetes pod model with pause containers for namespace sharing:
Pod Architecture:
Example pod specification:
apiVersion: v1
kind: Pod
metadata:
name: simple-container-task
labels:
app: my-app
bundle: ./rk8s/project/test/bundles/pause
spec:
containers:
- name: main-container1
image: ./rk8s/project/test/bundles/busybox
args:
- "dd"
- "if=/dev/zero"
- "of=/dev/null"
ports:
- containerPort: 80
resources:
limits:
cpu: "500m"
memory: "512Mi"
status:The compose functionality represents rk8s's philosophy of providing familiar developer experiences while maintaining Kubernetes compatibility. This approach bridges the gap between local development workflows and production Kubernetes deployments.
Design Philosophy:
Example compose specification:
services:
backend:
container_name: back
image: ./project/test/bundles/busybox
command: ["sleep", "300"]
ports:
- "8080:8080"
networks:
- libra-net
volumes:
- ./tmp/mount/dir:/app/data
frontend:
container_name: front
command: ["sleep", "300"]
image: ./project/test/bundles/busybox
ports:
- "80:80"
networks:
libra-net:
driver: bridge
configs:
backend-config:
file: ./config.yamlDirect CLI interaction with local container runtime:
Full Kubernetes-like cluster with distributed components:
…cd rk8s/project/
cargo build -p rkl
cargo build -p rkssudo cp test/test.conflist /etc/cni/net.dmkdir -p rootfs
docker export $(docker create busybox) | tar -C rootfs -xvf -Single Container:
sudo project/target/debug/rkl container run single.yaml
sudo project/target/debug/rkl container list
sudo project/target/debug/rkl container exec single-container-test /bin/shPod Management(Standalone):
sudo project/target/debug/rkl pod run pod.yaml
sudo project/target/debug/rkl pod state simple-container-task
sudo project/target/debug/rkl pod exec simple-container-task container-name /bin/shPod Management(Cluster):
# Create pod via RKS control plane
sudo project/target/debug/rkl pod create pod.yaml --cluster 127.0.0.1:50051
# List pods from RKS
sudo project/target/debug/rkl pod list --cluster 127.0.0.1:50051
# Delete pod via RKS
sudo project/target/debug/rkl pod delete simple-container-task --cluster 127.0.0.1:50051Daemon Mode:
sudo RKL_ADDRESS=127.0.0.1:50051 project/target/debug/rkl pod daemon # Monitors /etc/rk8s/manifests/ and acts as work node of rksRKS: For detail about building a cluster with RKS and RKL, please refer to RKS–RKL usage.
The rk8s project relies on community contributions and aims to simplify getting started. Pick an issue, make changes, and submit a pull request for community review.
More information on contributing to rk8s is available in the Contributing Guide.
Discord Channel: https://discord.gg/hKAypQUEzE
No open issues yet, or sync has not completed.