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
Expose API for blocking and initiating reboots #662
We have multiple requests for a way for external components to initiate the drain+reboot. Other software can do this but if it's not coordinated with the MCO problems will arise.
We face a tension for whether some of this functionality should be part of the MCO itself, but anyways here's a strawman:
/run/machine-config-operator/rebooting is a flag file the MCO writes when it starts a drain+reboot.
/run/machine-config-operator/reboot-lock.d/
is a directory, and a component can do e.g.: echo preparing new kernel module > /run/machine-config-operator/reboot-lock.d/nvidia
As long as at least 1 entry exists, the MCO will not initiate a drain + reboot. However in order to avoid a race condition, external components must check if /run/machine-config-operator/rebooting exists after they wrote a lock file - if it does, they lost a race and should not attempt any host modifications.
/run/machine-config-operator/reboot-start.d/
When the app has completed its preparation, it does: mv /run/machine-config-operator/reboot-{lock,start}.d/nvidia
And the MCD will start a drain+reboot when there is at least 1 entry in .start.d and no locks.
I have a use case for this API. Now we are working on an operator which can setup the SRIOV NIC on baremetal hosts. We plan to support NICs from Intel and Mellanox.
However, for Mellanox NICs, to enable the SRIOV and set the max number of VFs, it requires to use 'mstconfig' tool to configure the firmware, then to reboot the node to take effect[1]. So we would like to have this API so that rebooting can be better coordinated among the cluster. So that we don't need to implement the drain+reboot logic in our own daemon.
The tuned use-case for needing to trigger reboots is when tuned adds kernel command line options that are part of a tuned profile. Several discussions occurred with the perf team and MCO team over the last 6 months about ensuring tunings delivered via tuned are clearly & cleanly coordinated with the MCO and MCD.
I was thinking more about this recently and I think there are even cases where we want this inside the MCO itself effectively.
This is related to work on early kargs but it's really generic to the situation where the MCD detects "drift" from the desired state. In that case if the MCD wants to reconcile, it needs to coordinate with the node controller by requesting a reboot.
@cgwalters#388 is for RHCOS only, right? What is the plan for BYOH case?
Sorry I didn't follow up on this. I think the general consensus is that we shouldn't try to get the MCO too much into the "grey area" of "we'll partially manage this node". So if we had this API it would allow e.g. someone to use Puppet/Ansible or whatever on a traditional RHEL system and change kargs, then request a reboot coordinating with the MCO.
OK let me straw man out a simplistic version of this.
If /run/machine-config-operator-reboot exists, the MCD will add a machineconfiguration.openshift.io/reboot-requested annotation. The node controller will create a machineconfiguration.openshift.io/reboot-approved annotation on at most one node at a time.
This would happen even for MCO-initiated upgrades; today, the controller setting desiredConfig is implicitly taken by the MCD as permission to reboot.
Probably, the controller should for now set reboot-approvedanddesiredConfig at the same time. But you could imagine that e.g. semantics for desiredConfig but notreboot-approved is that we try to "prepare" for an update..e.g. we can pull the oscontainer at least.
Anyways, the MCD would react to having both reboot-requested and reboot-approved as permission to drain+reboot.
If reboot-requested exists but the file in /run doesn't, the MCD would simply delete both annotations (if they exist) and not reboot.
This version of the proposal doesn't have any locking; we can add that later.
Side note...it sure seems like kebab-case is the most prevalent for values such as container names, annotations and labels etc., and currentConfig and desiredConfig should really be current-config and desired-config...
To add on the Ceph storage requirements, their scenario is as follows:
upgrade (or config change is initiated)
despite the maxUnavailable set for a pool, the storage operator has an additional requirement to avoid draining+rebooting the next node unless the previous being updated is healthy && the ceph cluster becomes healthy as well
the above means there must be something which controls the upgrade/config change steps
This issue/proposal looks like it could solve the issue above, by providing an API for external component to control whether to go ahead and drain+reboot a node (this is limited to reboot right?).
They can drive the "hold" through an annotation maybe and MCD respects that as well
OK, currently our definition of "healthy" is "kubelet is up and MCD running". If we had a mechanism for other pods or daemonsets to register with us and block completion, that seems like it'd be sufficient right?
I guess one example here is - until the SDN pod lands in practice no other workloads are going to function - should the MCO know about this and avoid starting to drain other nodes until SDN is up?
Hmm. Are these ceph pods pinned to nodes? For example they are using a raw block device attached to the machine?
OK, currently our definition of "healthy" is "kubelet is up and MCD running". If we had a mechanism for other pods or daemonsets to register with us and block completion, that seems like it'd be sufficient right?
this is indeed super helpful - I thought about that above being driven by annotation but maybe you have another idea? The issue here could be "who removes the "hold" annotation" probably
OK, currently our definition of "healthy" is "kubelet is up and MCD running".
For our requirement, it's ceph cluster reports healthy.
If we had a mechanism for other pods or daemonsets to register with us and block completion, that seems like it'd be sufficient right?
If by completion, you mean proceeding with any reboots, then yeah. Making the reasonable assumption that we can block before you proceed to the next node.
Hmm. Are these ceph pods pinned to nodes? For example they are using a raw block device attached to the machine?
The tuned use-case for needing to trigger reboots is when tuned adds kernel command line options that are part of a tuned profile.
I really rather strongly think only the MCO should be writing kernel arguments. See #388
If only MCO should be writing "kernel arguments"/bootloader config, is there any plan to support this on RHEL7/8 hosts too? The functionality is needed by other operators and some are already taking matters into their hands.
I'll describe some problems from the KNI perspective, which includes ceph on bare metal hyperconverged (running on all nodes, including masters).
MachineConfigPools are not a useful boundary for preserving availability. While we configure masters and workers differently, we need something like MaxUnavailable to apply across all machines because relevant workloads like ceph run across all machines.
Node readiness is not the best metric for availability. In the course of recovering from a failure, a Node may be deleted and replaced. From an availability perspective, the Node's absence may be just as significant as its lack of readiness. It would be a shame for it to no longer be counted in the unavailability calculation after it gets deleted. It would be better to use something like the cluster-api's MachineSet to know how many Machines and Nodes should exist vs. do exist.
The "paused" feature might help, but something will need to actively manage it. We have at least two reasons so far to pause a pool: 1) only one pool at a time can be un-paused, because we can't have two nodes taken down at the same time even if they're in different pools. 2) we would need to pause all pools any time ceph is unhealthy.
Perhaps the MachineConfigPool is not the best place to express availability limits. Something like the MachineDisruptionBudget could be a better choice. Of course that would require MCO to integrate with the cluster-api, but that could have a lot of advantages. Is there a particular design argument for why these limits should be expressed on the MachineConfigPool? Or was that a matter of not having sufficient reason at the time to put it somewhere else?
Ultimately it's hard to express the kind of availability constraints that ceph has through any of MachineConfigPools, PodDisruptionBudgets, or MachineDisruptionBudgets.
MCO drains prior to rebooting nodes, however on bare metal there is much more value in triage and repair of problems - so we're interested in something that just does drain.
As discussed on aos-devel, MCO's co-operative reboot mechanism isn't usable for fencing/remediation because we've lost the ability to communicate with it. However it would be desirable for MCO and machine health check to respect the same "leave this node alone" mechanism/annotation.
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
pliurh commentedon Apr 25, 2019
I have a use case for this API. Now we are working on an operator which can setup the SRIOV NIC on baremetal hosts. We plan to support NICs from Intel and Mellanox.
However, for Mellanox NICs, to enable the SRIOV and set the max number of VFs, it requires to use 'mstconfig' tool to configure the firmware, then to reboot the node to take effect[1]. So we would like to have this API so that rebooting can be better coordinated among the cluster. So that we don't need to implement the drain+reboot logic in our own daemon.
[1]https://access.redhat.com/articles/3082811
jeremyeder commentedon Apr 25, 2019
The tuned use-case for needing to trigger reboots is when tuned adds kernel command line options that are part of a tuned profile. Several discussions occurred with the perf team and MCO team over the last 6 months about ensuring tunings delivered via tuned are clearly & cleanly coordinated with the MCO and MCD.
/cc @runcom @jmencak
cgwalters commentedon Apr 25, 2019
I really rather strongly think only the MCO should be writing kernel arguments. See #388
pliurh commentedon May 10, 2019
@cgwalters #388 is for RHCOS only, right? What is the plan for BYOH case?
cgwalters commentedon Jun 27, 2019
I was thinking more about this recently and I think there are even cases where we want this inside the MCO itself effectively.
This is related to work on early kargs but it's really generic to the situation where the MCD detects "drift" from the desired state. In that case if the MCD wants to reconcile, it needs to coordinate with the node controller by requesting a reboot.
cgwalters commentedon Jun 27, 2019
Sorry I didn't follow up on this. I think the general consensus is that we shouldn't try to get the MCO too much into the "grey area" of "we'll partially manage this node". So if we had this API it would allow e.g. someone to use Puppet/Ansible or whatever on a traditional RHEL system and change kargs, then request a reboot coordinating with the MCO.
cgwalters commentedon Jul 2, 2019
OK let me straw man out a simplistic version of this.
If
/run/machine-config-operator-rebootexists, the MCD will add amachineconfiguration.openshift.io/reboot-requestedannotation. The node controller will create amachineconfiguration.openshift.io/reboot-approvedannotation on at most one node at a time.This would happen even for MCO-initiated upgrades; today, the controller setting
desiredConfigis implicitly taken by the MCD as permission to reboot.Probably, the controller should for now set
reboot-approvedanddesiredConfigat the same time. But you could imagine that e.g. semantics fordesiredConfigbut notreboot-approvedis that we try to "prepare" for an update..e.g. we can pull the oscontainer at least.Anyways, the MCD would react to having both
reboot-requestedandreboot-approvedas permission to drain+reboot.If
reboot-requestedexists but the file in/rundoesn't, the MCD would simply delete both annotations (if they exist) and not reboot.This version of the proposal doesn't have any locking; we can add that later.
cgwalters commentedon Jul 2, 2019
Side note...it sure seems like
kebab-caseis the most prevalent for values such as container names, annotations and labels etc., andcurrentConfiganddesiredConfigshould really becurrent-configanddesired-config...cgwalters commentedon Jul 2, 2019
Aaah now that I look e.g. this
Nodeobject hasWhich includes camelCase, PascalCase, kebab-case, and snake_case (which seems to be our fault). Anyways I can't unsee it send help
cgwalters commentedon Jul 8, 2019
PR for this in #926
runcom commentedon Jul 10, 2019
To add on the Ceph storage requirements, their scenario is as follows:
This issue/proposal looks like it could solve the issue above, by providing an API for external component to control whether to go ahead and drain+reboot a node (this is limited to reboot right?).
They can drive the "hold" through an annotation maybe and MCD respects that as well
rohantmp commentedon Jul 10, 2019
Yup, that description of the ceph use case is accurate!
cgwalters commentedon Jul 10, 2019
OK, currently our definition of "healthy" is "kubelet is up and MCD running". If we had a mechanism for other pods or daemonsets to register with us and block completion, that seems like it'd be sufficient right?
I guess one example here is - until the SDN pod lands in practice no other workloads are going to function - should the MCO know about this and avoid starting to drain other nodes until SDN is up?
Hmm. Are these ceph pods pinned to nodes? For example they are using a raw block device attached to the machine?
runcom commentedon Jul 10, 2019
this is indeed super helpful - I thought about that above being driven by annotation but maybe you have another idea? The issue here could be "who removes the "hold" annotation" probably
rohantmp commentedon Jul 10, 2019
For our requirement, it's ceph cluster reports healthy.
If by completion, you mean proceeding with any reboots, then yeah. Making the reasonable assumption that we can block before you proceed to the next node.
In baremetal environments they would be.
12 remaining items
jmencak commentedon Aug 6, 2019
If only MCO should be writing "kernel arguments"/bootloader config, is there any plan to support this on RHEL7/8 hosts too? The functionality is needed by other operators and some are already taking matters into their hands.
mhrivnak commentedon Sep 16, 2019
I'll describe some problems from the KNI perspective, which includes ceph on bare metal hyperconverged (running on all nodes, including masters).
MachineConfigPools are not a useful boundary for preserving availability. While we configure masters and workers differently, we need something like
MaxUnavailableto apply across all machines because relevant workloads like ceph run across all machines.Node readiness is not the best metric for availability. In the course of recovering from a failure, a Node may be deleted and replaced. From an availability perspective, the Node's absence may be just as significant as its lack of readiness. It would be a shame for it to no longer be counted in the unavailability calculation after it gets deleted. It would be better to use something like the cluster-api's MachineSet to know how many Machines and Nodes should exist vs. do exist.
The "paused" feature might help, but something will need to actively manage it. We have at least two reasons so far to pause a pool: 1) only one pool at a time can be un-paused, because we can't have two nodes taken down at the same time even if they're in different pools. 2) we would need to pause all pools any time ceph is unhealthy.
Perhaps the MachineConfigPool is not the best place to express availability limits. Something like the MachineDisruptionBudget could be a better choice. Of course that would require MCO to integrate with the cluster-api, but that could have a lot of advantages. Is there a particular design argument for why these limits should be expressed on the MachineConfigPool? Or was that a matter of not having sufficient reason at the time to put it somewhere else?
Ultimately it's hard to express the kind of availability constraints that ceph has through any of MachineConfigPools, PodDisruptionBudgets, or MachineDisruptionBudgets.
Potentially helpful docs from rook:
@beekhof FYI
beekhof commentedon Oct 14, 2019
MCO drains prior to rebooting nodes, however on bare metal there is much more value in triage and repair of problems - so we're interested in something that just does drain.
As discussed on aos-devel, MCO's co-operative reboot mechanism isn't usable for fencing/remediation because we've lost the ability to communicate with it. However it would be desirable for MCO and machine health check to respect the same "leave this node alone" mechanism/annotation.
openshift-bot commentedon Sep 18, 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 20, 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 19, 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 19, 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.
daemon: Add /run/machine-config-daemon-force stamp file