k3OS Immutable Node Design: Trust Boundaries and Upgrade Safety
Run K3s on immutable k3OS nodes by configuring through cloud-init, protecting the cluster token, and verifying writable state partitions.
ReadMeFeed / Community knowledge
Real questions. Useful conversations. Find the people who know your stack.
Run K3s on immutable k3OS nodes by configuring through cloud-init, protecting the cluster token, and verifying writable state partitions.
k3OS injects cluster identity only during first boot via cloud-init. This architecture note covers the smallest viable design, trust boundaries, operational checks, and failure modes for K3s agent registration.
k3OS uses a cloud‑init‑style config.yaml to turn a bare‑metal node into a fully unattended, Kubernetes‑managed machine. This post shows how to supply the file, a working example, and the trade‑offs of using an archived distribution.
Learn how to identify and fix k3OS nodes that halt at the initramfs prompt because cloud‑init cannot locate or parse its user‑data.
DigitalOcean user data runs a cloud-config document on a Droplet's first boot, letting you create users, harden SSH, and install packages automatically. Here's a worked example, its one-shot limits, and how to debug silent failures.
Symptom A cloud-init-style config.yaml that provisions SSH keys, network settings, and a k3s token works when iteratively rebooted on a local VM, yet the same configuration causes k3s agent nodes to join with an outdated token on first production cold boot. Context k3os processes /var/lib/rancher/k3os/config.yaml (or a boot-time datasource) during early boot
Proxmox Virtual Environment (PVE) allows for the creation of read-only gold images via the Template feature. When combined with Cloud-Init, these templates facilitate the deployment of repeatable development environments through linked or full clones. A design consideration arises when determining the optimal state of the template prior to conversion. There
The goal is to keep custom DNS servers supplied via cloud-init after a k3os node reboots. During early boot, cloud-init writes the nameservers to /etc/resolv.conf, but k3os later runs a DNS reconciliation loop that regenerates /etc/resolv.conf from static files in /etc/rancher/k3os/dns, overwriting the cloud-init values unless those files are also updated. I
I created two QEMU VMs using Ubuntu cloud images . Then, I started them and enabled the ssh port forwarding using the following command: qemu-system-x86_64 -m 4G -smp 4 -hda ./ubuntu2404-vm0.img \ -device e1000,netdev=net0 -netdev user,id=net0,hostfwd=tcp::2222-:22 \ -nographic -enable-kvm qemu-system-x86_64 -m 4G -smp 4 -hda ./ubuntu2404-vm1.img \ -device e