In addition to Weibo, there is also WeChat
Please pay attention

WeChat public account
Shulou
2025-11-02 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the example analysis of garbage collection mechanism in kubernetes, which has a certain reference value, and interested friends can refer to it. I hope you will gain a lot after reading this article.
One: preface
After the Kubernetes system is running for a long time, Kubernetes Node downloads a lot of images, among which there may be many expired images. At the same time, because of running a large number of containers, the container will become a dead container after launch, leaving the data on the host, so that both expired images and dead containers will take up a lot of hard disk space. If the disk space is used up, a very bad situation may occur, and it may even lead to disk damage. For this reason, kubelete will clean up the garbage, that is, regularly clean up expired images and dead containers. It is not recommended to use other management tools or manual cleaning of containers and images, because kubelet needs to judge the running status of pod through containers. If you use other methods to clean containers, it may affect the normal work of kubelet.
Second: image cleanup
Kubernetes collects images through cadvisor integrated with kubelet. There are two parameters that can be set:-- image-gc-high-threshold and-- image-gc-low-threshold. Image recycling will be triggered when the disk utilization used to store the image reaches-- image-gc-high-threshold, and the most recently unused (LRU,Least Recently Used) image will be deleted until the disk utilization drops to-- image-gc-low-threshold or there is no image to delete. By default-the image-gc-high-threshold is 90, and the threshold is 80.
Three: container cleaning
There are three parameters that can be set for container recycling:
1.--minimum-container-ttl-duration: the minimum TTL that a death container can be deleted. Default is 1 minute.
2.--maximum-dead-containers-per-container: the maximum number of dead containers allowed per Pod. Default is 2.
3.--maximum-dead-containers: the maximum number of dead containers that exist in the run. The default value is 100.
Kubelet performs container cleanup regularly. Each time, the dead container is deleted according to the above three parameters. Usually, priority is given to deleting the dead container with the longest creation time. Kubelet does not delete containers that are not managed by Kubelet.
Thank you for reading this article carefully. I hope the article "sample Analysis of garbage Collection Mechanism in kubernetes" shared by the editor will be helpful to you. At the same time, I also hope that you will support and pay attention to the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope





About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.