-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Updated container garbage collection with accurate information #48001
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -166,17 +166,25 @@ is restarted, the tracked image age is reset, causing the kubelet to wait the fu | |||||||||||||||||||||||||||||||||||||||||||||||||||||||
based on image age. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{< /note>}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Container garbage collection {#container-image-garbage-collection} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
### Container garbage collection {#container-image-garbage-collection} (deprecated) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{< caution >}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Container garbage collection is deprecated in favour of `--eviction-hard` or | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
`--eviction-soft` and will be removed in a future version. For more details on | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
eviction policy, see [node-pressure-eviction](/docs/concepts/scheduling-eviction/node-pressure-eviction/). | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
{{< /caution >}} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
+169
to
+175
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These command line arguments are deprecated, and the format isn't right. Try this:
Suggested change
ℹ️ I am not sure about which version deprecated setting these command line arguments. Am I right that eviction is always at the Pod level, whereas these deprecated settings apply at the container level? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
The kubelet garbage collects unused containers based on the following variables, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
which you can define: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* `MinAge`: the minimum age at which the kubelet can garbage collect a | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
container. Disable by setting to `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* `MaxPerPodContainer`: the maximum number of dead containers each Pod | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
can have. Disable by setting to less than `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* `MinAge`: the minimum age at which the kubelet can garbage collect a container. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disable by setting a kubelet config flag `--minimum-container-ttl-duration` to `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* `MaxPerPodContainer`: the maximum number of dead containers each Pod can have. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disable by setting a kubelet config flag `--maximum-dead-containers-per-container` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
to less than `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
* `MaxContainers`: the maximum number of dead containers the cluster can have. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disable by setting to less than `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Disable by setting a kubelet config flag `--maximum-dead-containers` | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
to less than `0`. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Comment on lines
177
to
+187
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this right?
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yeah I agree we should refer folks to the kubelet configuration options as we're redirecting folks away from using the CLI There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WDYT ^ @T-Lakshmi ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @haircommander, But my concern is the below statement is true or not?
also when container GC got deprecated and what are the recommended way to use as alternate to container GC? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also here it mentioned old logs are stored outside of container's context. Is that true? if true, in which location old logs are storing now? |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
In addition to these variables, the kubelet garbage collects unidentified and | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
deleted containers, typically starting with the oldest first. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
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.
container gc and eviction are different things ...
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.
Hello @tengqm,
Can you clarify on the below points of container gc?
--minimum-container-ttl-duration
,--maximum-dead-containers
and--maximum-dead-containers-per-container
related to container gc?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.
Container GC is a task performed by kubelet regularly. The command line flags you mentioned are about container GC. The things that got deprecated, IIRC, are the command line flags. The intent of the deprecation was to reduce knobs for users to tune.
With the mechanism still there in kubelet, container GC won't go away any time soon. I'm not aware of anyone pushing this forward. In other words, the "deprecation" itself may get rotten (or deprecated).
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.
Thanks for sharing feedback @tengqm.
What others say on this? Please share your opinion.