Enable garbage collection of custom resources#47665
Enable garbage collection of custom resources#47665k8s-github-robot merged 1 commit intokubernetes:masterfrom
Conversation
|
@k8s-bot pull-kubernetes-unit test this |
|
@k8s-bot pull-kubernetes-verify test this |
9845efa to
c49ae04
Compare
0a87fee to
2f28fce
Compare
There was a problem hiding this comment.
I preferred the construct that got back a caching discovery client and simply started a gofunc that called reset.
There was a problem hiding this comment.
So building a restmapper gives me back a function that somehow handles the garbage collector? that feels weirdly intertwined.
There was a problem hiding this comment.
This part of the code was authored by @lavalamp so I can't speak to the decisions leading to the current design, but it works and so I kept it. If you feel strongly we can continue the discussion about a different factoring.
There was a problem hiding this comment.
If you feel strongly we can continue the discussion about a different factoring.
I feel strongly. I'm not certain that the monitor sync has to line up exactly with the restmapper sync, but if it does, pass both through to the garbage collector and have the function live there.
There was a problem hiding this comment.
If you feel strongly we can continue the discussion about a different factoring.
still outstanding.
There was a problem hiding this comment.
Why don't we make them stop channels here?
There was a problem hiding this comment.
Using a nil stop channel to indicate the monitor's start/stopped state.
There was a problem hiding this comment.
Using a nil stop channel to indicate the monitor's start/stopped state.
doced and I didn't read to it before commenting her?
|
Macro-level observation. This makes creating links to resources hosted outside of the main API server exciting. If the API server goes down, then every resource with an owner-ref to it will be reaped. |
There was a problem hiding this comment.
This is HasSynced is different than a normal HasSynced method which only moves to true and never back to false. I think this method is IsSynced.
There was a problem hiding this comment.
I'd expect this in client-go.
There was a problem hiding this comment.
Does this ever fail for legitimate reasons, like a CRD being deleted for instance.
There was a problem hiding this comment.
Given that this will prevent proper handling higher up the chain, it seems worth a utilruntime.HandleError.
There was a problem hiding this comment.
How about getting this merged separately and see about making use of it in the namespace cleanup controller? It's a smaller controller and it would reduce the size of this pull.
There was a problem hiding this comment.
No objection from me. Who else might have an opinion on this?
There was a problem hiding this comment.
No objection from me. Who else might have an opinion on this?
Me, @sttts (who will agree with me), and @caesarxuchao who will also likely agree.
There was a problem hiding this comment.
Not a fan of this construct. The garbagecollector already has a reference to this RESTMapper, that seems like a more proper place to tie these things together. You could isolate this to a member function there instead of returning a function to be called later with the thing that requested this.
Automatic merge from submit-queue (batch tested with PRs 49712, 49694, 49714, 49670, 49717) Reduce GC e2e test flakiness Increase GC wait timeout in a flaky e2e test. The test expects a GC operation to be performed within 30s, while in practice the operation often takes longer due to a delay between the enqueueing of the owner's delete operation and the GC's actual processing of that event. Doubling the time seems to stabilize the test. The test's assumptions can be revisited, and the processing delay under load can be investigated in the future. Extracted from #47665 per #47665 (comment). /cc @sttts @caesarxuchao @deads2k @kubernetes/sig-api-machinery-bugs ```release-note NONE ```
|
/lgtm |
|
@ironcladlou could you open an issue saying that we need to add tests to validate that GC works with aggregated apis? |
|
/assign @deads2k |
|
/approve no-issue |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: caesarxuchao, deads2k, ironcladlou Associated issue: 44507 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
|
Opened #49801 for followup. |
|
Thank you @ironcladlou for the hard work. |
Team effort! ✋ |
|
/test all [submit-queue is verifying that this PR is safe to merge] |
|
@ironcladlou: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. DetailsInstructions 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 understand the commands that are listed here. |
|
Automatic merge from submit-queue (batch tested with PRs 49538, 49708, 47665, 49750, 49528) |
| // TODO: Consider how this could be represented with table-style tests (e.g. a | ||
| // before/after expected object graph given a delete operation targetting a | ||
| // specific node in the before graph with certain delete options). | ||
| func TestMixedRelationships(t *testing.T) { |
There was a problem hiding this comment.
This is flaking according to http://storage.googleapis.com/k8s-metrics/flakes-latest.json
There was a problem hiding this comment.
Thanks- will look into it
Enhance the garbage collector to periodically refresh the resources it monitors (via discovery) to enable custom resource definition GC (addressing #44507 and reverting #47432).
This is a replacement for #46000.
/cc @lavalamp @deads2k @sttts @caesarxuchao
/ref #48065