Repository navigation
Bug 1724155: MCO/MCD: sync deployment before controllerconfig, roll out MCDs before MCC and remove pivot's reboot-needed file - #887
Conversation
|
I'm not sure about the second commit |
|
This actually went through and we can see in logs that the MCD waited for the MCC as well to come up and publish the rendered MC on cluster setup.
|
|
/retest |
From just poking around maybe bc that logging comes from checkStateOnFirstRun() machine-config-operator/pkg/daemon/daemon.go Line 800 in 05bdb21 machine-config-operator/pkg/daemon/daemon.go Line 223 in 05bdb21 From looking through the files that's the only way outside of being a RHEL7 that it would retain the value of false. |
aec9f7e to
3bdf661
Compare
|
working as expected now and MCDs roll out before MCC |
|
All the code looks good to me, and I know you wanted to test this in CI but - I am going to be a pain about the commit message bodies being empty. Mind doing e.g. I use Another important thing is...5 years down the line, maybe the GH business model isn't quite working out and they let go one of their database people and then later some of the historical PR discussions get lost... but with git, it's forever. (I still wish sometimes we backed up even the PR review discussions reliably but that's another issue) |
no pain, I usually do that anyway but forget from time to time and I agree it's freaking important to have it (I look it up from vscode as well!) |
There was a problem hiding this comment.
Also this one could really use a comment like:
// This is written by code injected by the MCS, but we always want the MCD to be in control of reboots
An osimageurl change from an upgrade can race with the old MCC. This patch makes sure we roll out the new MCC before applying the new osimageurl ConfigMap that is then templated by the new MCC.
We can still be running the old MCDs on nodes once the new MCC creates the new rendered so fix that by rolling out the MCDs first and then the new MCC.
If the node has never rebooted and ConditionFirstBoot is thus True, pivot reboots the node causing an upgrade failure The reboot-needed file controls that but we want the MCD to be the only in charge of reboots so always remove it when running pivot from the MCDs.
if we're inDesiredConfig but Degraded it means we failed somehow the very first actions (i.e. 404 on the rendered MC). But if we're in Desired config there's no reason NOT to set Done when everything reconciles back to current == desired.
3bdf661 to
acc0950
Compare
|
Took care of @cgwalters comments! |
| // if we're degraded here, it means we got an error likely on startup and we retried | ||
| // if it's the case, clear it out | ||
| if state.state == constants.MachineConfigDaemonStateDegraded { | ||
| if err := dn.nodeWriter.SetDone(dn.kubeClient.CoreV1().Nodes(), dn.nodeLister, dn.name, state.currentConfig.GetName()); err != nil { |
There was a problem hiding this comment.
Would it be better to just call completeUpdate as the code right above this is doing in case there's somehow still a cordon? I wonder if we should always call SetDone here like this:
diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go
index 0c8630d2..ff33afa0 100644
--- a/pkg/daemon/daemon.go
+++ b/pkg/daemon/daemon.go
@@ -895,9 +895,6 @@ func (dn *Daemon) checkStateOnFirstRun() error {
if dn.recorder != nil {
dn.recorder.Eventf(getNodeRef(dn.node), corev1.EventTypeNormal, "NodeDone", fmt.Sprintf("Setting node %s, currentConfig %s to Done", dn.node.Name, state.pendingConfig.GetName()))
}
- if err := dn.nodeWriter.SetDone(dn.kubeClient.CoreV1().Nodes(), dn.nodeLister, dn.name, state.pendingConfig.GetName()); err != nil {
- return errors.Wrap(err, "error setting node's state to Done")
- }
if out, err := dn.storePendingState(state.pendingConfig, 0); err != nil {
return errors.Wrapf(err, "failed to reset pending config: %s", string(out))
}
@@ -922,6 +919,11 @@ func (dn *Daemon) checkStateOnFirstRun() error {
}
}
+ if state.state != constants.MachineConfigDaemonStateDone {
+ if err := dn.nodeWriter.SetDone(dn.kubeClient.CoreV1().Nodes(), dn.nodeLister, dn.name, state.pendingConfig.GetName()); err != nil {
+ return errors.Wrap(err, "error setting node's state to Done")
+ }
+ }
glog.Infof("In desired config %s", state.currentConfig.GetName())
// All good!
?
There was a problem hiding this comment.
Eh...it's OK we can do this type of detail in a later followup.
|
/approve |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cgwalters, runcom The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/cherrypick release-4.1 |
|
@runcom: #887 failed to apply on top of branch "release-4.1": DetailsIn 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. |
|
I knew it -.- |
|
working on a patch for 4.1 |
|
@runcom: This pull request references a valid Bugzilla bug. DetailsIn 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. |
MCO/MCD: sync deployment before controllerconfig, roll out MCDs before MCC and remove pivot's reboot-needed file
This patch set takes care of mainly three issues we've spotted:
The above have been fixed by:
/etc/pivot/reboot-neededwhen running pivot from the MCD