Using k3OS Immutable Root Filesystem for Reliable Cluster Upgrades
Learn how k3OS’s immutable root filesystem and overlay partition enable atomic, verifiable upgrades and eliminate OS drift in Kubernetes edge nodes.
11 Nov 2025, 21:18 UTC

Problem: OS drift breaks upgrade reliability
When a Linux node is upgraded by installing packages in‑place, configuration files can diverge from the original image. Over time this drift makes it hard to know exactly what version is running and complicates rollback. In a Kubernetes edge environment where nodes may be rebooted frequently, an unpredictable base OS can cause subtle failures that are difficult to trace.
Thesis: k3OS solves drift by keeping the root filesystem read‑only and using an overlay for all mutable data, enabling atomic, verifiable upgrades.
How the immutable layout works
k3OS boots a minimal Alpine‑based system where the root partition (/) is mounted ro. All writes that would normally go to /etc, /var, or /usr are redirected to a writable overlay partition mounted at /var/lib/k3os/overlay. The overlay holds container images, logs, k3s state, and any user‑added files that must survive a reboot. Because the underlying OS image never changes on disk, upgrading means swapping the entire read‑only image for a new one.
Declarative boot configuration with cloud‑init
At first boot k3OS accepts a cloud‑init user‑data file that can set:
- hostname
- SSH authorized keys
- k3s role (server or agent)
- external datastore endpoint (etcd, external DB, etc.)
This eliminates the need for post‑install scripts and ensures every node starts from the same known state.
Worked example: performing an atomic upgrade
Assume you have a running k3OS node and you have built a new ISO image hosted at http://upgrade.example.com/k3os-v0.22.0.iso. The steps are:
- Log in to the node (requires sudo or root).
- Run the upgrade command, providing the URL and optionally a SHA256 checksum for verification:
- The command downloads the ISO, checks its checksum, extracts the new squashfs image, and adds a new GRUB menu entry labeled something like
k3os-v0.22.0. - Reboot the node:
- On the next boot GRUB presents the new entry; selecting it boots the freshly installed read‑only root filesystem.
- After login, verify the overlay is still in use and the root is read‑only:
- If the new kernel panics or health checks fail, k3OS automatically boots the previous GRUB entry, providing a rollback without manual intervention.
sudo k3os upgrade http://upgrade.example.com/k3os-v0.22.0.iso
sudo reboot
mount | grep -E ' / |overlay'
Expected output (example):
/dev/sda2 on / type ext4 (ro,relatime)
/dev/sda3 on /var/lib/k3os/overlay type ext4 (rw,relatime)
Trade‑off: overlay size must be planned
The overlay partition is created when the k3OS image is built and its size is fixed. If the overlay fills with container images, logs, or persistent application data, write operations can fail and the node may become unresponsive. Operators should:
- Estimate the maximum overlay usage (e.g., based on expected image cache size and log retention).
- Allocate a sufficiently large overlay when building the custom ISO (using the
--overlay-sizeflag of the k3OS image builder). - Monitor usage regularly with
df -h /var/lib/k3os/overlayand set alerts when usage exceeds 80 %.
Actionable closing
Adopting k3OS means treating the OS as a replaceable artifact rather than a mutable system. By keeping the root read‑only and using an overlay for state, you gain:
- Atomic upgrades with automatic rollback.
- A minimal attack surface because no packages can be installed outside the image.
- Predictable node behavior across reboots.
Start by building a custom k3OS ISO that includes your desired overlay size, deploy it with a cloud‑init file that defines your k3s role, and use the k3os upgrade command for future updates. Verify each step with the mount checks shown above, and you’ll have a reliable, drift‑free foundation for your Kubernetes edge workloads.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.