Skip to main content

One post tagged with "RISC-V"

View All Tags

The Heterogeneous Fleet: The RISC-V Chapter

· 12 min read

I now have Kairos running on a RISC-V board, with Kubernetes, A/B upgrades, rollback, and an upgradable recovery image. Even better, that board has joined my little fleet alongside x86 and ARM machines.

It started in March, at KubeCon Europe 2026 in Amsterdam, when I met Fabrizio Sgura, a CNCF Ambassador. We had a great time talking, and at some point he said something along the lines of:

“Mauro, we need to get Kairos running on RISC-V.”

He introduced me to Ludovic Henry from the RISC-V community, created a WhatsApp group for the three of us, and started telling me about the possibilities of RISC-V.

Apparently, that was all the convincing I needed.

On April 10, less than three weeks after KubeCon, I was already pushing my first changes to bring RISC-V support to Kairos. Seven months later, this is what my fleet looks like.

Kairos fleet interface showing two x86_64 nodes, one aarch64 node, and one riscv64 node, all online. The architecture column comes from Kairos PR #6172.

Four machines, three architectures, one Kairos fleet. The newcomer is hermes, a StarFive VisionFive 2 running a hand-built Kairos v4.4.0 image based on Ubuntu 24.04.

These machines aren’t necessarily part of the same Kubernetes cluster, but they can be managed through the same operating system lifecycle model. That’s the part I’m most excited about.

Getting there was an engineering problem. Supporting RISC-V in every release is mostly an economic and organizational one: who builds it, on what infrastructure, how often, and who keeps it working. So far, that has been the harder part.

One fleet, different everything​

Kairos is an open-source project that brings immutable, image-based operating system management to different Linux distributions (Ubuntu, openSUSE and others) and Kubernetes distributions (k3s and k0s). Installation, declarative configuration, atomic A/B upgrades, rollback, and recovery work the same way regardless of what is underneath.

We already supported amd64 and arm64. RISC-V was the next test of that model.

Adding another architecture isn’t just a build flag​

Kairos depends on more than a few Go binaries: distributions, kernels, bootloaders, installation tools, image builders, and upgrade mechanisms all need to work together. The RISC-V work touched several projects:

  • kairos-init: RISC-V images and architecture-specific packages.
  • kairos-agent and kairos-sdk: architecture detection, installation, EFI bootloader paths, and upgrades.
  • AuroraBoot: bootable ISOs and disk images.
  • Hadron: RISC-V support in our minimal Linux distribution and its build system.

Some fixes were simple, such as package names or EFI paths. For others I had to build components from source because RISC-V artifacts weren’t available.

By August, I had a Kairos image based on Ubuntu 24.04 running under QEMU, with k3s on RISC-V. I didn’t port Kubernetes myself: my experimental images use the k3s fork from the team at CARV-ICS-FORTH, who have been working on bringing Kubernetes and k3s to RISC-V.

I then published an open invitation for people to test Kairos on RISC-V.

From QEMU to a VisionFive 2​

Thanks to Spectro Cloud, I got my hands on a StarFive VisionFive 2.

StarFive VisionFive 2 board on my desk.

The first boot attempt reached GRUB, which started loading the kernel, but then failed with a trap in OpenSBI, the interface between the operating system and the machine’s firmware. Updating the board to the latest vendor firmware, JH7110_VF2_6.12_v6.0.0, didn’t help.

The breakthrough came from Crazyscorpio88, who tested my image on the same board and reported that flashing newer mainline U-Boot and OpenSBI to SPI flash, taken from the firmware Ubuntu ships (U-Boot 2025.10), allowed it to boot. The same configuration got my board working: after flashing it, the boot log showed U-Boot 2025.10 and OpenSBI v1.2.

Someone with the same hardware had found a solution and saved me hours of investigation. That’s one of my favorite parts of working on open-source projects.

Beyond a bootable image​

Kairos running on the VisionFive 2, with k3s reporting a Ready control-plane node.

As of November 19, I’ve validated the following on actual RISC-V hardware:

  • Booting and installing Kairos from a live ISO.
  • Running the CARV-ICS-FORTH k3s fork, with the Kubernetes node reporting Ready.
  • Performing an A/B upgrade.
  • Rolling back to the previous system.
  • Upgrading the recovery system.

That meets the bar I wanted to reach before calling this more than a proof of concept. One qualifier on the last item: I upgraded the recovery image, which isn’t the same as validating a recovery operation, and given the state reset problem below, I wouldn’t call recovery validated.

During a state reset, the 6.3 GB state partition filled up, leaving a truncated passive.img and dropping the machine into a dracut emergency shell. Worse, kairos-agent reset had reported success.

The board can run headless using serial or SSH with the standard kernel, but getting HDMI output required an experimental kernel with additional display support and a custom device tree. I also haven’t tested k0s on the board yet.

The cost of keeping it building​

We’re not ready to ship supported RISC-V releases yet, and the biggest obstacle is no longer getting Kairos to run. It’s the cost of keeping it building.

The images I have today, including the one on the VisionFive 2, are based on Ubuntu. A RISC-V image based on Hadron, Kairos’ minimal Linux distribution, comes next. In Hadron, uncached builds of a few components looked like this (median times):

Componentamd64arm64riscv64 under QEMU
systemd~19 min~20 min~94 min
CMake~11 min~14 min~76 min
Python~9 min~11 min~54 min
Kernel~25 min~25 min~66 min

The amd64 and arm64 jobs ran on CNCF runners with 16 or 32 vCPUs in September and October. The riscv64 jobs ran under QEMU on a 32-vCPU x86 VM between April and June, and their times varied a lot: the kernel build took 28 to 117 minutes. I don’t have per-component numbers for native riscv64. A cold native build of the Hadron toolchain on a RISE runner had not finished after 10 hours, when I stopped it.

For a native comparison, I ran two other builds on native runners with 4 CPUs and 15 GB, for all three architectures: CMake from source, and a cold Go build of the Kairos agent, immucore and the SDK. Both used the Alpine compiler in a container, not the Hadron toolchain.

Native buildamd64arm64riscv64
CMake16m 38s9m 19s~108m (projected)
Kairos Go components63s40s7m 8s

The riscv64 CMake build did not complete: it hadn’t finished after 90 minutes and was on track for about 108, so that figure is an estimate. The Go build finished everywhere, and there native riscv64 was about 7 times slower than amd64 and about 11 times slower than arm64.

These aren’t controlled architectural benchmarks, but they illustrate the practical cost of building RISC-V software with the infrastructure available to us today.

Hadron’s RISC-V build pipeline is currently disabled: the last actual build jobs ran in June, and the workflow has used a no-op job since July.

On native RISC-V runners, between June and August, our distribution-based kairos-init tests generally took 20 to 25 minutes. Median queue time was short, although some runs waited much longer. In AuroraBoot, in October, linking the RISC-V binary alone took 23 minutes and 52 seconds on a native runner, while an entire amd64 unit-test job completed in 4 minutes and 9 seconds. Those aren’t equivalent workloads or hardware, so that isn’t a benchmark either.

None of this is a complaint about the runners. The RISE project provides the native RISC-V ones and the CNCF the amd64 and arm64 ones, and without them none of this work would be possible. My point is the cost to the maintainer team: a RISC-V pipeline in every build and release means more build time, flaky or blocking jobs, release gating, and people to keep it green. As far as I know, nobody is using Kairos on RISC-V in production yet, so that cost has to be justified.

We’ve already paid some of it: we had to restructure AuroraBoot’s release pipeline after RISC-V build failures started affecting releases for other architectures. The RISC-V release build was disabled, then re-enabled in September with changes that stop one architecture from blocking the whole release.

Weekly releases make slow builds more expensive​

At Kairos, we’re moving from a feature release roughly once a quarter to one every week (patch releases were already more frequent). A pipeline that adds hours to a release is tolerable a few times a year. Every week, a flaky job that needs a rerun takes a much bigger share of the time between two releases.

Development is getting faster, with AI-assisted development as one of the reasons. But every change, whatever its source, still has to be built and validated on every supported architecture, and that part hasn’t sped up with it: a kernel takes as long to compile and an image as long to boot and test.

I don’t think this is specific to RISC-V. In any project with a build matrix, the slowest entry either sets how often you can release or has to stop gating the release.

Before considering specialized pipelines, I’d rather find out how much of the build we can improve for everyone, with better caching and less repeated work across build stages.

The RISC-V chicken-and-egg problem​

There is also a limit to what we can do within Kairos: we depend on upstream projects that are still working toward RISC-V support. Upstream k3s doesn’t yet publish a supported riscv64 release, which is why my image relies on the CARV-ICS-FORTH fork. k0s has been working on RISC-V support, but doesn’t provide the same precompiled releases as for its established architectures. Both are active discussions:

Ludovic Henry explained the broader problem in his announcement of the RISE RISC-V runners: hardware vendors need software support to attract users, and software projects need access to hardware to develop and test that support.

This is why the work of Ludovic and the RISE community matters: besides contributing upstream, they’ve made native RISC-V CI available to open-source projects, including Kairos and k0s. And every upstream project that starts publishing supported RISC-V artifacts reduces the architecture-specific work that projects like Kairos have to maintain.

We cannot solve that coordination problem ourselves, but we can contribute patches, test the available infrastructure, report what doesn’t work, and make it easier for the next project to follow.

What needs to happen before a supported release?​

I’m happy with how far this has come. This is what’s left:

  • Re-enabling Hadron’s RISC-V pipeline in a way that fits our regular release process, and building the Hadron-based image.
  • Supported upstream Kubernetes artifacts for riscv64.
  • Fixes for the issues the VisionFive 2 uncovered, starting with the state reset.
  • Testing k0s, and testing on more boards.

I don’t have a date for supported RISC-V releases. This has been a side project for me, worked on when I could, so progress hasn’t always been consistent.

If you want to try it, the experimental riscv64 images I used (Ubuntu 24.04, Kairos v4.4.0, k3s from the CARV-ICS-FORTH fork) are published as releases in my kairos-images repository: a generic riscv64 image and a VisionFive 2 image with HDMI. Neither is an official Kairos release. If you have RISC-V hardware and want to help, start with the VisionFive 2 installation documentation. The remaining work is in our open issues labelled riscv64.

Thanks to Fabrizio for suggesting this in the first place, Ludovic and the RISE community for their work on upstream support and CI infrastructure, Crazyscorpio88 for testing and documenting the VisionFive 2, CARV-ICS-FORTH for the Kubernetes port, the Kairos contributors who helped bring the architecture up, and Spectro Cloud for providing the hardware.

Seven months after that conversation at KubeCon, RISC-V has joined my Kairos fleet. The next milestone isn’t getting it to boot on another board. It’s getting to a point where releasing Kairos for RISC-V is as unremarkable as releasing it for amd64 or arm64. That’s when I’ll consider the job done.