Skip to content

"Applied ImageConfig cluster on MachineConfigPool" logs too frequently? #453

Closed

Description

@runcom

If you deploy with the latest MCO, you'll get something like this in logs, haven't had any time to debug but I don't expect it to happen if nothing changes in the image crd right?

those are the logs from the controller in openshift-image-config-operator namespace:

I0218 16:57:08.906648       1 kubelet_config_controller.go:138] Starting MachineConfigController-KubeletConfigController
I0218 16:57:08.906710       1 render_controller.go:112] Starting MachineConfigController-RenderController
I0218 16:57:09.006890       1 node_controller.go:121] Starting MachineConfigController-NodeController
I0218 16:57:09.207226       1 container_runtime_config_controller.go:146] Starting MachineConfigController-ContainerRuntimeConfigController
I0218 16:57:14.406590       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool master
I0218 16:57:18.913811       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool worker
I0218 17:19:07.012628       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool master
I0218 17:19:07.612416       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool worker
I0218 17:41:03.812710       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool master
I0218 17:41:04.412112       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool worker
I0218 18:03:00.211793       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool worker
I0218 18:03:00.911832       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool master
I0218 18:24:56.507045       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool master
I0218 18:24:56.913486       1 container_runtime_config_controller.go:592] Applied ImageConfig cluster on MachineConfigPool worker

Activity

  1. umohnani8 commented on Feb 18, 2019

    @umohnani8
    Contributor

    Yeah it shouldn't. But this looks like the image config informer keeps saying that the image CR has been updated every 20 mins or so. Plus you see two of each log because there are two MCPs and it applies the image config changes to both.
    I guess I could add a check to see if there were any changes to the RegistrySources field when the informer says an update has happened.

  2. runcom commented on Feb 18, 2019

    @runcom
    MemberAuthor

    Yeah it shouldn't. But this looks like the image config informer keeps saying that the image CR has been updated every 20 mins or so

    yeah, let's understand why we're getting that as well if it's not supposed to do that (or as you said, filter out stuff when nothing has changed).

  3. kikisdeliveryservice commented on Feb 19, 2019

    @kikisdeliveryservice
    Contributor

    I saw this as well on a new cluster that was basically idle after spinning it up (ie made no changes or did anything with it but still saw the logging).

  4. umohnani8 commented on Feb 19, 2019

    @umohnani8
    Contributor

    So we start a sharedFactoryInformer (https://github.com/openshift/machine-config-operator/blob/master/cmd/common/controller_context.go#L44) with the objects that have informers/listers in client-go and set the resyncPeriod to about 20 minutes in https://github.com/openshift/machine-config-operator/blob/master/cmd/common/helpers.go#L31. This just resyncs the listers every few minutes to ensure that we have the most up to date cache of the object.
    I followed what the Informers.AddEventHandler function does, and it looks like every resyncPeriod it adds a notification of the object and sends it over, so we get that the object has been updated. The controller sees that and calls the syncImageHandler function to update the registries.conf.

  5. runcom commented on Feb 19, 2019

    @runcom
    MemberAuthor

    So we start a sharedFactoryInformer (https://github.com/openshift/machine-config-operator/blob/master/cmd/common/controller_context.go#L44) with the objects that have informers/listers in client-go and set the resyncPeriod to about 20 minutes in https://github.com/openshift/machine-config-operator/blob/master/cmd/common/helpers.go#L31. This just resyncs the listers every few minutes to ensure that we have the most up to date cache of the object.
    I followed what the Informers.AddEventHandler function does, and it looks like every resyncPeriod it adds a notification of the object and sends it over, so we get that the object has been updated. The controller sees that and calls the syncImageHandler function to update the registries.conf.

    right but we would love to not run a resync if the config hasn't updated wrt what we previously observed. In the Kubelet and ContainerRuntime Config(s) we skip a sync if we already observed that given generation (meaning, the object hasn't changed). The Images CRD doesn't have an ObservedGeneration in its status, so I'm wondering how can we filter out not needed resync.

  6. umohnani8 commented on Feb 19, 2019

    @umohnani8
    Contributor

    I noticed the same thing happening for the two CRs, Infrastructure and Network, that the operator keeps track of - it also gets a resync about every 20 mins.
    I opened #461 with an extra filter to double check that an actual change has happened to registrySources from the image CR before applying any changes.
    Not sure how exactly we want to handle the resync + observation.

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions