You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
consider making config changes truly transactional on RHCOS #1190
With ostree, each deployment (bootable target) has its own copy of /etc.
Today, the MCD writes into the current/etc. This has weird side effects; for example, it means that we may be affecting running static pods for kubelet. We may rewrite the pull secret.
It also means we don't have rollback at the ostree level.
It'd be fairly easy to change the MCD to (on RHCOS) create a new deployment for pure config changes, and write the new changes to /etc there - leaving the booted system untouched.
This would mean that config changes would be fully transactional and offline, the same way OS updates are.
Another way to look at this is, it'd enforce that config changes require a reboot.
We could drop the hacks around using journald for which config we're in, because /etc becomes transactional. (And much closer to being immutable - see also coreos/rpm-ostree#702 )
This proposal looks interesting!
One question though - will this apply on firstboot of node as well? This question is because today mcd available on host reads MachineConfig and writes /etc/ignition-machine-config-encapsulated.json during firstboot which is later used by mcd to apply kargs in firstboot.
One question though - will this apply on firstboot of node as well?
I don't see a blocker to doing this on firstboot too.
Looks like I might have misunderstood little bit making /etc/ changes transactional.
What will happen with this proposal in place during firstboot? Most likely during firstboot we will have config changes (like new file to be added in /etc/ignition-machine-config-encapsulated.json ) and also new machine-os-content. Today, we create new deployment for mchine-os-content changes which gets applied after reboot. What will happen to files like /etc/ignition-machine-config-encapsulated.json, will it be written to current deployment or in new deployment?
The problem is that doing the naive thing and always doing an OS update before config changes would force double reboots for every upgrade.
We could try to detect "major version" upgrades and force doing the OS update first there...wouldn't be terribly hard, but would add noticeable latency to upgrades.
What will happen with this proposal in place during firstboot?
...
What will happen to files like /etc/ignition-machine-config-encapsulated.json, will it be written to current deployment or in new deployment?
That's a good question. Note that today, it's Ignition which writes the initial files, not the MCD. So unless we changed how Ignition works too, the answer would be that the files are written in the current root.
And in fact, we need this to happen because we need the pull secret /var/lib/kubelet/config.json in the current root so that podman can pull the oscontainer. (In general, we need other configs for that too too, such as any image content source policy, certificates, proxy config etc.)
I think it's OK if we only do this "transactional /etc" for MCD upgrades, because that's where we're actually doing an upgrade, and we have a workload running on the cluster.
Also a prerequisite is moving the pull secret from /var into /etc - and in general, all MachineConfig changes.
Eh, thinking about this more it's not a hard dependency - we can just make changes to /etc transactional, and say that things outside of it aren't. In practice, the pull secret doesn't change often or in an incompatible way. What we need is transactional changes for the static pods etc. which should be in /etc.
That's a good question. Note that today, it's Ignition which writes the initial files, not the MCD. So unless we changed how Ignition works too, the answer would be that the files are written in the current root.
Ah right, makes sense to me now. thanks for the explanation.
Dropping this here for lack of a better place: A much bigger path we could take would be to have the MCO build a derived OSTree commit from the rendered MachineConfig (like as a build process) and serve that to other nodes in the cluster. This means we're not going into each node and changing config files (or things like the kernel-rt overrides) and also leads more strongly towards having /etc mounted read-only by default.
But going this path takes us entirely away from supporting traditional RHEL - so we'd also need to do #1592
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
Reopen the issue by commenting /reopen.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Exclude this issue from closing again by commenting /lifecycle frozen.
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
In recent discussion it was realized that a slightly hacky but totally viable way to do this would be for the MCO to take the Ignition config content under filesystem: and synthesize an RPM from it, then rpm-ostree install ./machine-config.rpm.
We've thought about this some in the context of non-RPM content; some discussion related to that in coreos/rpm-ostree#2326
And various prep work for it has landed, but it's not going to be soon. Whereas layering RPMs works today.
One thing the MCO could do today is: Before initiating any node level changes to /etc, run ostree admin deploy --not-as-default <current commit> (and we could wrap this in rpm-ostree too, but the ostree API exists today).
The effect of this is that we snapshot the current /etc before the MCO mutates it, and it would help ensure that rpm-ostree rollback (or just picking the previous bootloader entry) has a consistent state.
A downside of this approach is that by snapshotting the current /etc, it re-introduces race conditions with any processes besides the MCO that are live-mutating /etc. (Which apparently includes various daemonsets, there's also LVM which writes state in /etc).
A downside of this approach is that by snapshotting the current /etc, it re-introduces race conditions with any processes besides the MCO that are live-mutating /etc. (Which apparently includes various daemonsets, there's also LVM which writes state in /etc).
Right. Another example is SRIOV operator that makes direct changes to node as they perform some per node config changes.
Activity
cgwalters commentedon Oct 18, 2019
Another way to look at this is, it'd enforce that config changes require a reboot.
We could drop the hacks around using journald for which config we're in, because
/etcbecomes transactional. (And much closer to being immutable - see also coreos/rpm-ostree#702 )cgwalters commentedon Oct 20, 2019
Also a prerequisite is moving the pull secret from
/varinto/etc- and in general, all MachineConfig changes.mrunalp commentedon Oct 20, 2019
👍 IIUC, this would prevent new static pod manifests to take effect until we reboot.
sinnykumari commentedon Oct 21, 2019
This proposal looks interesting!
One question though - will this apply on firstboot of node as well? This question is because today mcd available on host reads MachineConfig and writes
/etc/ignition-machine-config-encapsulated.jsonduring firstboot which is later used by mcd to apply kargs in firstboot.cgwalters commentedon Oct 29, 2019
I don't see a blocker to doing this on firstboot too.
sinnykumari commentedon Nov 4, 2019
Looks like I might have misunderstood little bit making /etc/ changes transactional.
What will happen with this proposal in place during firstboot? Most likely during firstboot we will have config changes (like new file to be added in /etc/ignition-machine-config-encapsulated.json ) and also new machine-os-content. Today, we create new deployment for mchine-os-content changes which gets applied after reboot. What will happen to files like /etc/ignition-machine-config-encapsulated.json, will it be written to current deployment or in new deployment?
cgwalters commentedon Jan 6, 2020
The motivation for filing this issue was the etcd upgrade bug.
However, we're also now seeing this for kubelet config.
And see also a related podman config bug.
One comment I had on the podman bug was:
cgwalters commentedon Jan 6, 2020
That's a good question. Note that today, it's Ignition which writes the initial files, not the MCD. So unless we changed how Ignition works too, the answer would be that the files are written in the current root.
And in fact, we need this to happen because we need the pull secret
/var/lib/kubelet/config.jsonin the current root so thatpodmancan pull the oscontainer. (In general, we need other configs for that too too, such as any image content source policy, certificates, proxy config etc.)I think it's OK if we only do this "transactional /etc" for MCD upgrades, because that's where we're actually doing an upgrade, and we have a workload running on the cluster.
cgwalters commentedon Jan 6, 2020
Eh, thinking about this more it's not a hard dependency - we can just make changes to
/etctransactional, and say that things outside of it aren't. In practice, the pull secret doesn't change often or in an incompatible way. What we need is transactional changes for the static pods etc. which should be in/etc.sinnykumari commentedon Jan 7, 2020
Ah right, makes sense to me now. thanks for the explanation.
blocked-edges: Block edges for storage.conf machine-config bug
blocked-edges: Block edges for storage.conf machine-config bug
blocked-edges: Block edges for storage.conf machine-config bug
blocked-edges: Block edges for storage.conf machine-config bug
cgwalters commentedon Jul 8, 2020
Dropping this here for lack of a better place: A much bigger path we could take would be to have the MCO build a derived OSTree commit from the rendered MachineConfig (like as a build process) and serve that to other nodes in the cluster. This means we're not going into each node and changing config files (or things like the
kernel-rtoverrides) and also leads more strongly towards having/etcmounted read-only by default.But going this path takes us entirely away from supporting traditional RHEL - so we'd also need to do #1592
4 remaining items
openshift-bot commentedon Dec 24, 2020
Rotten issues close after 30d of inactivity.
Reopen the issue by commenting
/reopen.Mark the issue as fresh by commenting
/remove-lifecycle rotten.Exclude this issue from closing again by commenting
/lifecycle frozen./close
openshift-ci-robot commentedon Dec 24, 2020
@openshift-bot: Closing this issue.
Details
In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
cgwalters commentedon Feb 5, 2021
/lifecycle frozen
cgwalters commentedon Feb 5, 2021
xref ostreedev/ostree#2220
cgwalters commentedon Feb 5, 2021
Also of note, rpm-ostree is getting closer to stabilizing our "apply-live" code, xref https://lists.fedoraproject.org/archives/list/[email protected]/thread/MQWBKRFCYH2GB3CW5CG722RGQAEPHHAN/ - once that happens we can also support e.g. live-applying a subset of the changes to
/etc- and as well potentially things like "just cherry pick the new kubelet package" and take the kernel update downtime later.cgwalters commentedon Aug 26, 2021
In recent discussion it was realized that a slightly hacky but totally viable way to do this would be for the MCO to take the Ignition config content under
filesystem:and synthesize an RPM from it, thenrpm-ostree install ./machine-config.rpm.We've thought about this some in the context of non-RPM content; some discussion related to that in coreos/rpm-ostree#2326
And various prep work for it has landed, but it's not going to be soon. Whereas layering RPMs works today.
cgwalters commentedon Oct 28, 2021
One thing the MCO could do today is: Before initiating any node level changes to
/etc, runostree admin deploy --not-as-default <current commit>(and we could wrap this in rpm-ostree too, but the ostree API exists today).The effect of this is that we snapshot the current
/etcbefore the MCO mutates it, and it would help ensure thatrpm-ostree rollback(or just picking the previous bootloader entry) has a consistent state.A downside of this approach is that by snapshotting the current
/etc, it re-introduces race conditions with any processes besides the MCO that are live-mutating/etc. (Which apparently includes various daemonsets, there's also LVM which writes state in/etc).sinnykumari commentedon Oct 28, 2021
Right. Another example is SRIOV operator that makes direct changes to node as they perform some per node config changes.
cgwalters commentedon Nov 15, 2022
Closing this as a dup of #3137 which we'll hopefully do with layering.