flatcar-network: Use upstream network and resolved Dracut modules - #129
flatcar-network: Use upstream network and resolved Dracut modules#129chewi wants to merge 8 commits into
Conversation
We mount it in the minimal initrd and it never gets unmounted, so it's simpler to assume it's there. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
It was only used by Equinix Metal (Packet), which has now gone. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
The bootengine copies had gone out of sync, and we can just install coreos-init's copies. We need to adjust KeepConfiguration for the initrd environment though. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This was accidentally omitted. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
I added these when Dracut stopped simply installing all of them, but on reflection, Calico and veth are irrelevant in the initrd. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Our IP parser has some shortcomings and systemd-network-generator can simply do this for us. Afterburn is being modified to emit an environment file with SYSTEMD_PROC_CMDLINE because the generator won't read the existing /etc/cmdline.d file that was consumed by Dracut. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
Upstream have also added KubeVirt support here, but that hasn't been released yet. Bug: #117 Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
There was a problem hiding this comment.
Pull request overview
This PR updates Flatcar’s initrd networking flow to rely on upstream Dracut + systemd components (notably systemd-network-generator with an Afterburn-provided SYSTEMD_PROC_CMDLINE), while removing the bespoke ip= parsing and deduplicating network unit files that had drifted from upstream/coreos-init behavior.
Changes:
- Switch initrd networking from a custom
ip=parser + static.networkset to upstreamsystemd-network-generator, with Afterburn providingSYSTEMD_PROC_CMDLINEvia an environment file. - Remove various initrd units/config that assumed a
sysusr-usr.mountsystemd unit, aligning with/sysusrbeing mounted byminimal-init. - Clean up/realign Dracut module inclusion and installed network unit sources (drop local copies; install upstream copies; tweak
KeepConfigurationbehavior for initrd).
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| update-bootengine | Adjust Dracut module set: drop network from omit list and add flatcar-network. |
| dracut/53ignition/sysusr-usr-revdeps.conf | Remove sysusr cryptsetup revdeps drop-in. |
| dracut/53ignition/module-setup.sh | Stop installing flatcar-static-network.service and sysusr-usr cryptsetup drop-in. |
| dracut/53ignition/ignition-mount.service | Remove RequiresMountsFor=/sysusr/usr/ dependency. |
| dracut/53ignition/ignition-kargs.service | Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/). |
| dracut/53ignition/ignition-fetch.service | Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/). |
| dracut/53ignition/ignition-fetch-offline.service | Remove RequiresMountsFor=/sysusr/usr/ (keep /oem/). |
| dracut/53ignition/ignition-disks.service | Remove RequiresMountsFor=/sysusr/usr/. |
| dracut/53ignition/flatcar-static-network.service | Remove the legacy unit that generated .network files via coreos-metadata --network-units=.... |
| dracut/53ignition/flatcar-openstack-hostname.service | Drop sysusr-usr.mount ordering/requirement. |
| dracut/53ignition/flatcar-metadata-hostname.service | Drop sysusr-usr.mount ordering/requirement. |
| dracut/53ignition/flatcar-afterburn-network.service | Drop sysusr-usr.mount ordering/requirement. |
| dracut/50flatcar-network/zz-default.network | Remove local copy (intended to use upstream-installed copy). |
| dracut/50flatcar-network/yy-pxe.network | Remove local copy (intended to use upstream-installed copy). |
| dracut/50flatcar-network/yy-netroot.network | Tighten matching to exclude virtual NICs and loopback. |
| dracut/50flatcar-network/yy-azure-sriov.network | Remove local copy (intended to use upstream-installed copy). |
| dracut/50flatcar-network/yy-azure-sriov-coreos.network | Remove local copy (intended to use upstream-installed copy). |
| dracut/50flatcar-network/systemd-network-generator-afterburn.conf | Add drop-in to run Afterburn first and load /run/afterburn/network-generator.env for SYSTEMD_PROC_CMDLINE. |
| dracut/50flatcar-network/parse-ip-for-networkd.sh | Remove custom ip= parsing script. |
| dracut/50flatcar-network/parse-ip-for-networkd.service | Remove unit that ran the custom ip= parsing script. |
| dracut/50flatcar-network/module-setup.sh | Switch to upstream unit installation; adjust KeepConfiguration; wire Afterburn into systemd-network-generator; manage enable/disable of networkd/resolved/generator. |
| dracut/50flatcar-network/afterburn-network-kargs.service | Re-scope conditions and ordering (notably ProxmoxVE; order before dracut-cmdline.service); remove old install/PartOf wiring. |
| dracut/50flatcar-network/10-nodeps.conf | Remove the systemd-resolved drop-in. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| "$systemdnetwork"/{20-calico-tunl0,50-veth,98-{gce-coreos-virtio,gce-virtio,virtio}}.link | ||
| "$systemdnetwork"/{20-calico-tunl0,50-veth,98-{gce-coreos-virtio,gce-virtio,virtio}}.link \ | ||
| "$systemdnetwork"/yy-{azure-sriov{,-coreos},pxe}.network \ | ||
| "$systemdnetwork"/zz-default.network |
There was a problem hiding this comment.
If those are provided by coreos-init - should we add it as a post dependency to the bootengine ebuild?
tormath1
left a comment
There was a problem hiding this comment.
One question - but it looks good to me. It simplifies a lot this area. Thanks for the deep dive!
Our IP parser has some shortcomings and systemd-network-generator can simply do this for us. Afterburn is being modified (coreos/afterburn#1299) to emit an environment file with
SYSTEMD_PROC_CMDLINEbecause the generator won't read the existing /etc/cmdline.d file that was consumed by Dracut.This also deduplicates .network files in common with coreos-init. The bootengine copies had gone out of sync, and we can just install coreos-init's copies. We need to adjust
KeepConfigurationfor the initrd environment though.This partially addresses #117 by allowing afterburn-network-kargs.service to work with ProxmoxVE. We cannot allow KubeVirt yet because a new Afterburn release is needed first.
The rest is just small cleanups.
How to use
This is most effectively tested with ProxmoxVE. /run/systemd/networkd should include 20-eth0.network and 71-default.network generated from the two different mechanisms. They should be roughly similar.
Testing done
The most recent Jenkins build was successful. Earlier builds tested all the platforms successfully. I have also done a lot of manual testing with QEMU and ProxmoxVE.