k3os Config Fetched at Boot: Local config.yaml Works, Production Node Boots With Defaults
0 reputation · 18 Jul 2022, 02:00 UTC
0 reputation · 18 Jul 2022, 02:00 UTC
k3os reads most configuration from a cloud-config file at /var/lib/rancher/k3os/config.yaml, and that file can be supplied in more than one way. A locally installed node usually has it embedded on disk; a PXE or cloud-booted production node may instead fetch it from a remote URL named by kernel command-line parameters such as k3os.mode and its datasource options.
If the remote source is unreachable at boot, documented behavior is to continue without it, so the node starts with defaults instead of the intended hostname, SSH keys, or k3s registration arguments. Some settings also apply only on first boot or after explicit config reapplication, so a config validated in a local VM with console access is not equivalent to one applied on an already-initialized production disk.
Version sensitivity across the 0.x releases and the project's archived status add another layer: pinning the final release and migrating to a supported successor are both plausible, and the tradeoff is unresolved.
Which config source did the node actually use? Does the on-disk config match the intended one? And for a project no longer maintained, is pinning or migrating the better operational default?
The most likely cause is that the production node is being told at boot time to use a remote config source via kernel command-line parameters (such as k3os.mode and its datasource URL), and that fetch is either failing or overriding the local file. k3os is designed to continue booting when a remote config is unreachable, so the node comes up with defaults instead of your hostname, SSH keys, and k3s registration arguments. This is a likely explanation, not a confirmed one — the checks below will confirm it.
A local VM test is not equivalent to the production path for two reasons:
/var/lib/rancher/k3os/config.yaml from disk. A PXE- or cloud-booted node may be directed to a remote URL by kernel parameters, in which case the on-disk file is not the source of truth for that boot.config.yaml on an already-initialized node does not retroactively apply hostname, SSH, or k3s arguments.cat /proc/cmdlineLook for k3os.mode and any datasource URL parameters. Their presence means the boot was not relying solely on the local file.diff /var/lib/rancher/k3os/config.yaml /path/to/intended-config.yamlAlso check for any local.d overrides that may take precedence.journalctl -b | grep -i k3osDatasource fetch errors here distinguish "fetched the wrong source" from "fetch failed and continued with defaults." A serial console capture works if the journal is unavailable.k3os is archived and unmaintained, with final releases in the 0.x line. Pinning the last release freezes known bugs and unpatched components; migrating to a maintained successor (for example, standard k3s on a conventional or immutable distribution) trades migration effort for ongoing security updates. For an isolated lab node, pinning is a defensible default. For anything internet-facing or multi-tenant, migrating is the safer operational choice. Exact datasource parameter names and fallback behavior vary across 0.x releases, so verify against the docs for your pinned version.
The full output of cat /proc/cmdline from the production node would confirm which datasource was selected and change the recommendation from "check both paths" to a specific fix.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.