Skip to content

[RFE] pre/post application hooks, reboot definition #360

Closed

Description

@thoraxe

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".

Activity

  1. ashcrow commented on Jan 31, 2019

    @ashcrow
    Member
  2. runcom commented on Feb 1, 2019

    @runcom
    Member

    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).

  3. sdodson commented on Feb 1, 2019

    @sdodson
    Member

    Sounds dangerously close to MCO becoming a re-implementation of ansible tasks. Following the discussion here.

  4. cgwalters commented on Feb 1, 2019

    @cgwalters
    Member

    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.

  5. jlebon commented on Feb 1, 2019

    @jlebon
    Member

    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?)

  6. kikisdeliveryservice commented on Feb 1, 2019

    @kikisdeliveryservice
    Contributor

    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.

  7. openshift-bot commented on Sep 1, 2020

    @openshift-bot
    Contributor

    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

  8. added
    lifecycle/stale
    on Sep 1, 2020
  9. openshift-bot commented on Oct 1, 2020

    @openshift-bot
    Contributor

    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

  10. added
    lifecycle/rotten
    and removed
    lifecycle/stale
    on Oct 1, 2020
  11. openshift-bot commented on Nov 1, 2020

    @openshift-bot
    Contributor

    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

  12. openshift-ci-robot commented on Nov 1, 2020

    @openshift-ci-robot
    Contributor

    @openshift-bot: Closing this issue.

    Details

    In response to this:

    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

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rotten

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions