Skip to content

MachineConfigs can be garbage collected while a node is still booting #301

Closed

Description

@cgwalters

Splitting this out of #273 (comment)
#273 (comment)

Here are relevant mcc logs from a cluster spun up by that PR:

I0114 22:26:10.482441       1 render_controller.go:437] Generated machineconfig master-46c05bfb9cb3d4e05608277bb2cb0a5d from 1 configs: [{MachineConfig  00-master  machineconfiguration.openshift.io/v1  }]
I0114 22:26:11.589272       1 render_controller.go:437] Generated machineconfig master-7734c782bad1ead0f8ef5b6affcaf35c from 2 configs: [{MachineConfig  00-master  machineconfiguration.openshift.io/v1  } {Machin
eConfig  00-master-osimageurl  machineconfiguration.openshift.io/v1  }]
I0114 22:26:12.484212       1 render_controller.go:437] Generated machineconfig master-383ca913310d861fee0be89e6f1d0127 from 3 configs: [{MachineConfig  00-master  machineconfiguration.openshift.io/v1  } {Machin
eConfig  00-master-osimageurl  machineconfiguration.openshift.io/v1  } {MachineConfig  00-master-ssh  machineconfiguration.openshift.io/v1  }]
I0114 22:26:14.483810       1 render_controller.go:437] Generated machineconfig master-a206c9459a44d859587164a68bb484f2 from 4 configs: [{MachineConfig  00-master  machineconfiguration.openshift.io/v1  } {Machin
eConfig  00-master-osimageurl  machineconfiguration.openshift.io/v1  } {MachineConfig  00-master-ssh  machineconfiguration.openshift.io/v1  } {MachineConfig  01-master-kubelet  machineconfiguration.openshift.io/
v1  }]

You can see that this caused very fast churn in the machineconfigs, and the previous ones were GCd. But - there were secondary masters that were still booting and expecting to be able to find that MC.
This is a tricky problem - we need to have a way to avoid pruning "in flight" MCs passed from the MCC to Ignition.

Activity

  1. cgwalters commented on Jan 14, 2019

    @cgwalters
    MemberAuthor

    This problem is actually fairly new (as of basically since Friday) because of the near-simultaneous addition of -ssh and -kubelet MCs which causes MC regeneration churn immediately on cluster bringup, and I'm currently going to add another.

  2. ashcrow commented on Jan 14, 2019

    @ashcrow
    Member

    /kind bug

  3. added
    kind/bug
    on Jan 14, 2019
  4. kikisdeliveryservice commented on Jan 14, 2019

    @kikisdeliveryservice
    Contributor

    As a data point, the -ssh mc was added last Monday, so any idea why you saw the issues begin on Friday? I also haven't see any MC race symptoms running on AWS.

  5. cgwalters commented on Jan 15, 2019

    @cgwalters
    MemberAuthor

    As a data point, the -ssh mc was added last Monday, so any idea why you saw the issues begin on Friday?

    Sorry, I was wrong. It's likely the -kubelet one on top of the -ssh - but both are pretty recent.

  6. jlebon commented on Jan 15, 2019

    @jlebon
    Member

    Hmm, wonder if it'd work to add another owner reference from the MCD on the MC before handling it. Let me look into that.

  7. jlebon commented on Jan 16, 2019

    @jlebon
    Member

    So, just to do a brain dump on this. I'm still trying to reproduce this locally. It doesn't trigger at least when I manually create MCs in rapid succession (this is with #303 reverted). One thing that caught my eye though is that there is no code today that actually deletes MachineConfigs, right?

    The render controller does try to remove the pool ownerReference from previously generated MachineConfigs (that actually doesn't work right now; working on a patch to fix that), but even so, deleting the ownerRef doesn't automatically delete the object, it just orphans them (which is actually an issue; we need to figure out garbage collection).

  8. cgwalters commented on Jan 16, 2019

    @cgwalters
    MemberAuthor

    The render controller does try to remove the pool ownerReference from previously generated MachineConfigs (that actually doesn't work right now; working on a patch to fix that),

    Something in that CI run was pruning MCs though.

    it just orphans them (which is actually an issue; we need to figure out garbage collection).

    Doesn't Kube itself do the GC https://blog.openshift.com/garbage-collection-custom-resources-available-kubernetes-1-8/ ?

    We should indeed figure this issue out better but it's not in the blocking path right now I'd say.

  9. ashcrow commented on Jan 16, 2019

    @ashcrow
    Member

    We should indeed figure this issue out better but it's not in the blocking path right now I'd say.

    Agreed

  10. 23 remaining items

  11. kikisdeliveryservice commented on Jan 18, 2019

    @kikisdeliveryservice
    Contributor

    I thought that we had said that the 1 hour part didn't really work?

  12. cgwalters commented on Jan 18, 2019

    @cgwalters
    MemberAuthor

    MCD's from being scheduled on the workers until MC's are generated and available via the MCS.

    It's the inverse a bit of that right? We want to wait for ds/machine-config-daemon to be fully rolled out (and hence the MCD on each node has fetched its config) and then unpause the pools, no?

    EDIT: To clarify though I like this idea of keying off the MCD status.

  13. jlebon commented on Jan 18, 2019

    @jlebon
    Member

    And based on the discussion so far we shouldn't merge #318 right? Because it would make this worse (assuming the patch works and I would believe it does).

    It definitely works. :)

    Though I'd agree we shouldn't merge it until we have a better understanding of what's going on.

  14. cgwalters commented on Jan 18, 2019

    @cgwalters
    MemberAuthor

    Some work on "operator pause" here #329 - WIP, not really tested (since I'd have to make a custom release payload to do that sanely); going to hope CI runs it and see.

  15. cgwalters commented on Jan 19, 2019

    @cgwalters
    MemberAuthor

    OK I think I'm finally understanding this. No MCs are being GC'd. The problem is until the osimage work, we were relying on the fact that the MC generated by the bootstrap was exactly the same as the MC initially generated in the cluster. So we either need to render the osimageurl during bootstrap (probably best) or also render the base template MC without the osimageurl too (would seem fine).

    If I'm correct about this and one of those fixes works, this issue would then turn to the other problem of when we GC MCs.

  16. ashcrow commented on Jan 21, 2019

    @ashcrow
    Member

    OK I think I'm finally understanding this. No MCs are being GC'd. The problem is until the osimage work, we were relying on the fact that the MC generated by the bootstrap was exactly the same as the MC initially generated in the cluster. So we either need to render the osimageurl during bootstrap (probably best) or also render the base template MC without the osimageurl too (would seem fine).

    👍 yes! The original architecture passed to us was that the MC from bootstrap would end up being the same. This can't ALWAYS be counted on since it's possible someone may use an old MC when installing a new cluster, but, in those cases, the extra reboot and pivot to the updated MC would be expected and fine.

    I'm good with either or both of the above.

  17. cgwalters commented on Feb 1, 2019

    @cgwalters
    MemberAuthor

    Closing in favor of #354
    since there wasn't actually any GC #301 (comment)

  18. added a commit that references this issue on Apr 13, 2021
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

    kind/bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions