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
It came up in conversation today that it might be useful to be able to define pre/post application hooks and/or define whether or not node reboots are required. While sysctls aren't an ideal use case, they are a somewhat realistic one.
For example, on a regular system, applying a sysctl involves adding an /etc/sysctl.d file and then executing something like sysctl -p. A reboot isn't required to apply the change, but it would definitely make the change take effect.
In this particular instance, after the MachineConfig was applied (file created), the post-application-hook would be to execute sysctl -p. No further action (reboot) would be required. So you could have another flag that was reboot-required: false or something.
The chrony example in the machine-config-operator documentation is also realistic. I don't need to reboot the node just to apply the chrony config -- a post-application hook (systemctl restart chrony or similar) would be sufficient.
I can't think of a good pre-application hook example.
Note that "application" here means "applying the configuration to the relevant nodes".
I believe this makes sense and most of the time applying a MachineConfig doesn't really require an update (the case I have in mind is changing the crio configuration through the CRD, that just requires a systemctl restart crio.service). Chrony and sysctls are other great examples as post-hooks.
As for pre-hooks, not sure if we do already have something, but one could set up something to rename a file before updating it (mv file file.bak) for some reason.
I'm not really fond on the application naming though but we can bikeshed on that soon I guess.
So you could have another flag that was reboot-required: false or something.
While this might makes sense to lock down what users can/cannot do, I fear everyone else could/would come up with his own requirements and ask us to implement another knob for their own purposes. So, an example of hooks can be found in runc when people can set up their stuff pre/post container stuff and as long as it adheres to the specification, everything should be good.
There could also be other mean to have something like this if we have plugins on special hardware and configuration as well probably (reload gpus stuff w/o rebooting for instance, not sure though).
There's also the general pattern we have of defining custom CRDs for things. Today the kubelet bits are a special sub-controller; could imagine e.g. having a "NTP confg" CRD, and also teach the MCD how to live-apply NTP config changes.
Yeah, not a big fan of adding (to borrow a word from the RPM world) scriptlets. The way I was thinking about it, any kind of "skip reboot" optimization should probably live in the MCD itself since the MCD knows exactly what the diff is from the previous to the next config. (And it's flexible of course how that code plugs into the MCD, I think we were discussing a plugin system at some point?)
Along the lines of what @jlebon this seems outside of what the MCD is intended to do, ie apply changes in a controlled/predictable way. The ability for users to change the fundamental behavior so much could also really affect troubleshooting/maintenance/expectations down the line. I think it makes more sense for the MCD itself to define what it will do and how, which seems more in-line with our push to a self-managed cluster.
Mark the issue as fresh by commenting /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
Mark the issue as fresh by commenting /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting /lifecycle frozen.
If this issue is safe to close now please do so with /close.
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.
Activity
ashcrow commentedon Jan 31, 2019
/cc @runcom
runcom commentedon Feb 1, 2019
I believe this makes sense and most of the time applying a MachineConfig doesn't really require an update (the case I have in mind is changing the crio configuration through the CRD, that just requires a
systemctl restart crio.service). Chrony and sysctls are other great examples as post-hooks.As for pre-hooks, not sure if we do already have something, but one could set up something to rename a file before updating it (
mv file file.bak) for some reason.I'm not really fond on the application naming though but we can bikeshed on that soon I guess.
While this might makes sense to lock down what users can/cannot do, I fear everyone else could/would come up with his own requirements and ask us to implement another knob for their own purposes. So, an example of hooks can be found in runc when people can set up their stuff pre/post container stuff and as long as it adheres to the specification, everything should be good.
There could also be other mean to have something like this if we have plugins on special hardware and configuration as well probably (reload gpus stuff w/o rebooting for instance, not sure though).
sdodson commentedon Feb 1, 2019
Sounds dangerously close to MCO becoming a re-implementation of ansible tasks. Following the discussion here.
cgwalters commentedon Feb 1, 2019
There's also the general pattern we have of defining custom CRDs for things. Today the kubelet bits are a special sub-controller; could imagine e.g. having a "NTP confg" CRD, and also teach the MCD how to live-apply NTP config changes.
jlebon commentedon Feb 1, 2019
Yeah, not a big fan of adding (to borrow a word from the RPM world) scriptlets. The way I was thinking about it, any kind of "skip reboot" optimization should probably live in the MCD itself since the MCD knows exactly what the diff is from the previous to the next config. (And it's flexible of course how that code plugs into the MCD, I think we were discussing a plugin system at some point?)
kikisdeliveryservice commentedon Feb 1, 2019
Along the lines of what @jlebon this seems outside of what the MCD is intended to do, ie apply changes in a controlled/predictable way. The ability for users to change the fundamental behavior so much could also really affect troubleshooting/maintenance/expectations down the line. I think it makes more sense for the MCD itself to define what it will do and how, which seems more in-line with our push to a self-managed cluster.
openshift-bot commentedon Sep 1, 2020
Issues go stale after 90d of inactivity.
Mark the issue as fresh by commenting
/remove-lifecycle stale.Stale issues rot after an additional 30d of inactivity and eventually close.
Exclude this issue from closing by commenting
/lifecycle frozen.If this issue is safe to close now please do so with
/close./lifecycle stale
openshift-bot commentedon Oct 1, 2020
Stale issues rot after 30d of inactivity.
Mark the issue as fresh by commenting
/remove-lifecycle rotten.Rotten issues close after an additional 30d of inactivity.
Exclude this issue from closing by commenting
/lifecycle frozen.If this issue is safe to close now please do so with
/close./lifecycle rotten
/remove-lifecycle stale
openshift-bot commentedon Nov 1, 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 Nov 1, 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.