Skip to content

CARV-ICS-FORTH/kubernetes-riscv64

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes on RISC-V

As of mid-2023, Debian and Ubuntu Linux run on RISC-V, with container support enabled in the kernel by default, however lack Kubernetes binaries. Previous work in the direction of running containers and Kubernetes on RISC-V indicates that it is possible. Back then, Golang support for RISC-V was at “experimental” status; now RISC-V is fully supported, so cross-compiling to the new architecture should be easier.

This document marks our current progress in making Kubernetes available for RISC-V.

Hello RISC-V!

Running

In summary, the following commands should get you up and running with K3s:

# Download
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20241024/k3s-riscv64.gz.aa
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20241024/k3s-riscv64.gz.ab
wget https://github.com/CARV-ICS-FORTH/k3s/releases/download/20241024/k3s-riscv64.gz.ac
cat k3s-riscv64.gz.* | gunzip > /usr/local/bin/k3s
chmod +x /usr/local/bin/k3s

# Install
curl -sfL https://get.k3s.io > k3s-install.sh
INSTALL_K3S_SKIP_DOWNLOAD="true" bash -x k3s-install.sh

Note

Most container images are not available for RISC-V, so many applications may not run.

Check the examples folder for sample applications:

kubectl apply -f https://raw.githubusercontent.com/CARV-ICS-FORTH/kubernetes-riscv64/main/examples/hello-kubernetes.yaml

To install Argo Workflows:

kubectl create namespace argo
kubectl apply -n argo -f https://raw.githubusercontent.com/CARV-ICS-FORTH/kubernetes-riscv64/main/argo-workflows/install.yaml

K3s

K3s is a light-weight Kubernetes distribution that packs all necessary code into a single binary and needs a smaller memory footprint to run.

To cross-compile K3s to RISC-V, we also had to make required changes in its dependencies k3s-root (the base user space binaries for K3s) and runc (the tool that runs the containers).

Here is a list of submitted PRs:

Until RISC-V support is merged upstream in K3s, we maintain a fork with precompiled binaries. Each binary is built from the respective riscv64-release-* branch, that also uses available riscv64 container images by default.

We build K3s with:

# Build
rm -rf bin dist build
ARCH=riscv64 SKIP_IMAGE=true SKIP_VALIDATE=true SKIP_AIRGAP=true make

# Split
cd dist/artifacts
gzip < k3s-riscv64 | split -b 20M - k3s-riscv64.gz.

Supporting services and container images

K3s relies on several additional services and applications, which have been ported to RISC-V:

To build and upload the klipper-helm image from our fork, we run:

ARCH=riscv64 make
docker tag rancher/klipper-helm:dev carvicsforth/klipper-helm:v0.9.3-build20241008
docker push carvicsforth/klipper-helm:v0.9.3-build20241008

To build and upload the klipper-lb image from our fork, we run:

ARCH=riscv64 make
docker tag rancher/klipper-lb:dev carvicsforth/klipper-lb:v0.4.9
docker push carvicsforth/klipper-lb:v0.4.9

Other necessary container images, like the pause and metrics-server containers, can be found in the images folder.

Higher level services and applications

Higher level services ported to RISC-V:

To compile the Argo CLI for RISC-V, download our riscv64 branch of argo-workflows and run:

make dist/argo-linux-riscv64

To try it out:

cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
argo submit -n argo --watch https://raw.githubusercontent.com/CARV-ICS-FORTH/kubernetes-riscv64/main/argo-workflows/hello-world.yaml

Other applications ported to RISC-V:

Acknowledgements

This project has received funding from the European Union’s Horizon Europe research and innovation programme through projects RISER ("RISC-V for Cloud Services", GA-101092993), AERO ("Accelerated EuRopean clOud", GA-101092850) and from the Key Digital Technologies Joint Undertaking through project REBECCA ("Reconfigurable Heterogeneous Highly Parallel Processing Platform for safe and secure AI", GA-101097224). KDT JU projects are jointly funded by the European Commission and the involved state members (including the Greek General Secretariat for Research and Innovation).

About

Status of work on running Kubernetes on RISC-V

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published