-
Notifications
You must be signed in to change notification settings - Fork 38.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kubelet: add garbage collection for new runtime API #31326
Conversation
The second commit LGTM |
Reviewed 9 of 9 files at r1. pkg/kubelet/kuberuntime/kuberuntime_gc.go, line 28 [r2] (raw file):
I'd suggesting writing a brief explanation on how kubelet GC policy is interpreted in this file. pkg/kubelet/kuberuntime/kuberuntime_gc.go, line 84 [r2] (raw file):
I think podsandbox should also comply to Comments from Reviewable |
05e0627
to
5c69dfa
Compare
Review status: 6 of 11 files reviewed at latest revision, 2 unresolved discussions. pkg/kubelet/kuberuntime/kuberuntime_gc.go, line 28 [r2] (raw file):
|
@yujuhong The latest commit rewrites the gc logic and addresses the comments. PTAL. |
Hmm......I thought about it more, and I think the correct/easy way to do this is:
@feiskyer WDYT? (and sorry for the churn). |
@yujuhong So this means there will be no something like And the entire GC procedure will be:
|
@feiskyer because that can be expressed by CRI it'll have to be okay for any runtime that integrates that way (that is future rkt, if not current rkt). I agree with @yujuhong about that being the logical way to do it so long as I'm reading that correctly. I also think it might make sense to not count sandboxes as "containers" anywhere or in any of the math. Sandboxes should simply be removed immediately when there are no remaining containers in them and no intention of creating new containers in them. I think we can potentially make the code slightly simpler if we can assume that when all containers for a pod are laid out by age, each sandbox encompasses a non-overlapping contiguous segment of containers. I think that's always true, and makes it so that avoiding counting sandboxes and just auto-removing them when empty does more or less "the right thing". It's possible the above behaviour and assumptions are implicit in your comment, but I wanted to be a little more explicit about that part. |
Thanks for summarizing! I think this is what @feiskyer plans to do, if I read his comments correctly. |
|
Can one of the admins verify that this patch is reasonable to test? If so, please reply "ok to test". This message will repeat several times in short succession due to jenkinsci/ghprb-plugin#292. Sorry. |
5c69dfa
to
2619bed
Compare
*/ | ||
|
||
// Package kuberuntime contains an implementation of kubecontainer.Runtime using | ||
// the interface in pkg/kubelet/api/services.go. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no need to include services.go
in the path, pkg name is sufficient
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
lgtm. Leaving up to @yifan-gu for a final round. |
LGTM, thank you @feiskyer ! |
Need to squash the commits. Removed the lgtm label. |
3c78a81
to
35369ee
Compare
We found a Contributor License Agreement for you (the sender of this pull request) and all commit authors, but as best as we can tell these commits were authored by someone else. If that's the case, please add them to this pull request and have them confirm that they're okay with these commits being contributed to Google. If we're mistaken and you did author these commits, just reply here to confirm. |
35369ee
to
7a57302
Compare
CLAs look good, thanks! |
@yujuhong squashed. |
@feiskyer uh..more rebase. |
7a57302
to
f774a68
Compare
GCE e2e build/test passed for commit f774a68. |
@k8s-bot test this [submit-queue is verifying that this PR is safe to merge] |
GCE e2e build/test passed for commit f774a68. |
Automatic merge from submit-queue |
This PR adds garbage collection for new runtime API.
Note that this PR also adds
CreatedAt
andPodSandboxId
toListContainers()
result.CC @yujuhong @Random-Liu @kubernetes/sig-node @kubernetes/sig-rktnetes
This change is![Reviewable](https://camo.githubusercontent.com/2d899f4291d07d3cd2fa4aaae1e3b243f164c23fce87d30a589ace0d496a444c/68747470733a2f2f72657669657761626c652e6b756265726e657465732e696f2f7265766965775f627574746f6e2e737667)