Skip to content

Conversation

@comtalyst
Copy link
Collaborator

Fixes #

Description

Add some comments on instance garbage collection. See the changes for details.

How was this change tested?

Does this change impact docs?

  • Yes, PR includes docs updates
  • Yes, issue opened: #
  • No

Release Note


@comtalyst comtalyst force-pushed the comtalyst/garbage-collection-comments branch from 26e72aa to 24857fe Compare September 19, 2025 22:36
@comtalyst comtalyst changed the base branch from comtalyst/fix-generatenodeclaimname to main September 19, 2025 22:37
})...)
errs := make([]error, len(retrieved))
workqueue.ParallelizeUntil(ctx, 100, len(managedRetrieved), func(i int) {
// managedRetrieved, although represented as NodeClaim, is actually actually populated by provider.List() rather than sourcing from the cluster.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that Karpenter upstream does this a lot - for example the entire existence of cloudProvider.List and its implementation is coercing VMs into NodeClaims, rather than sourcing this data from the NodeClaim.

I think calling this out is good but I am not sure it makes sense to ask "should we change" since I think the whole CloudProvider interface is somewhat predicated on this being "the way it's done". It has confused me slightly a few times too.

// This 5m is more of a grace period for newly-created instances that have yet to populate NodeClaim after.
time.Since(managedRetrieved[i].CreationTimestamp.Time) > time.Minute*5 {
errs[i] = c.garbageCollect(ctx, managedRetrieved[i], nodeList)
// In the case that CreationTimestamp is irretrievable (epoch), grace period will effectively be disabled.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I am following this bit.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants