Bug 1841358 - MCO does not update kubelet.conf if KubeletConfig created before MCP
Summary: MCO does not update kubelet.conf if KubeletConfig created before MCP
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Node
Version: 4.5
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.6.0
Assignee: Ryan Phillips
QA Contact: Sunil Choudhary
URL:
Whiteboard:
Depends On:
Blocks: 1847562
TreeView+ depends on / blocked
 
Reported: 2020-05-28 23:52 UTC by Denys Shchedrivyi
Modified: 2020-10-27 16:02 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-10-27 16:01:56 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift machine-config-operator pull 1825 0 None closed Bug 1841358: kubelet: retry kubeletconfigs if the MCP pool is not found 2021-01-10 19:06:43 UTC
Red Hat Product Errata RHBA-2020:4196 0 None None None 2020-10-27 16:02:36 UTC

Description Denys Shchedrivyi 2020-05-28 23:52:16 UTC
Description of problem:
 I created KubeletConfig pointed to non-existing MCP - and it showed expected condition:

  Machine Config Pool Selector:
    Match Labels:
      machineconfiguration.openshift.io/role:  worker-cnf
Status:
  Conditions:
    Last Transition Time:  2020-05-28T19:24:03Z
    Message:               Error: could not find any MachineConfigPool set for KubeletConfig
    Status:                False
    Type:                  Failure


After that I created needed MCP and all data from MC was pushed to the node, but from KubeletConfig - was not. 



Version-Release number of selected component (if applicable):
# oc version
Client Version: 4.5.0-0.nightly-2020-05-26-063751
Server Version: 4.5.0-0.nightly-2020-05-26-063751


How reproducible:
100%

Steps to Reproduce:
1. create KubeletConfig with non-existing "Machine Config Pool Selector"
2. create MCP for this KubeletConfig


Actual results:
 Data from KubeletConfig was not pushed to the node, kubelet.conf on the node was not updated

Expected results:
 MCO updates kubelet.conf on the node as soon as right MCP is created.

Additional info:

 After re-creating/updating KubeletConfig MCO starts updating nodes.

Comment 1 Antonio Murdaca 2020-05-29 09:29:43 UTC
I'm pretty sure the KubeletConfig retries after a minute or so:

func (ctrl *Controller) handleErr(err error, key interface{}) {
	if err == nil {
		ctrl.queue.Forget(key)
		return
	}

	if _, ok := err.(*forgetError); ok {
		ctrl.queue.Forget(key)
		return
	}

	if ctrl.queue.NumRequeues(key) < maxRetries {
		glog.V(2).Infof("Error syncing kubeletconfig %v: %v", key, err)
		ctrl.queue.AddRateLimited(key)
		return
	}

	utilruntime.HandleError(err)
	glog.V(2).Infof("Dropping kubeletconfig %q out of the queue: %v", key, err)
	ctrl.queue.Forget(key)
	ctrl.queue.AddAfter(key, 1*time.Minute)
}

I'll spin up a cluster to confirm and setting to 4.6 if this behavior was already there.

Comment 2 Antonio Murdaca 2020-05-29 09:33:06 UTC
Oh, damn, so yeah, this is exactly the behavior:

var errCouldNotFindMCPSet = newForgetError(errors.New("could not find any MachineConfigPool set for KubeletConfig"))


So that error is a forget error and when you get it, the KubeletConfig controller doesn't retry. I'm leaving it to Ryan to assess why that's the case for a transient error but this definitely is the case with <4.5 as well so leaving 4.6 as the target.

Comment 3 Ryan Phillips 2020-06-15 17:39:03 UTC
Nice find. Yeah, we should probably retry in that instance. I'll PR the change.

Comment 6 MinLi 2020-06-22 04:09:00 UTC
verified with version : 4.6.0-0.nightly-2020-06-20-011219

Comment 8 errata-xmlrpc 2020-10-27 16:01:56 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (OpenShift Container Platform 4.6 GA Images), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2020:4196


Note You need to log in before you can comment on or make changes to this bug.