1. 程式人生 > 其它 >kubernetes 日常記錄

kubernetes 日常記錄

1.磁碟使用率達到85時,觸發imageGCManager

現象:
node event:

(combined from similar events): failed to garbage collect required amount of images. Wanted to free 50015916032 bytes, but freed 0 bytes
Source

message:

kubelet: I0629 10:56:28.575434  107257 image_gc_manager.go:371] [imageGCManager]: Removing image "sha256:471f9537bf3685f3befcd3a6d86f3ad991d5ae6e03a112de1d66278dc979037c" to free 1108218030 bytes
kubelet: E0629 10:56:29.117032  107257 kubelet.go:1298] Image garbage collection failed multiple times in a row: failed to garbage collect required amount of images. Wanted to free 45641629696 bytes, but freed 1129986950 bytes

解釋:
當kubelet檢測到磁碟使用率達到閥值,就會自動清理過期的image,釋放空間,這個閥值可通過kubelet引數調整。

$ kubelet --help | grep 85
      --image-gc-high-threshold int32                                                                             The percent of disk usage after which image garbage collection is always run. Values must be within the range [0, 100], To disable image garbage collection, set to 100.  (default 85) (DEPRECATED: This parameter should be set via the config file specified by theKubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.)