4

By default, image-gc-high-threshold and image-gc-low-threshold values are 90 and 80% respectively.

We want to change them to 80 and 70, How we can change the Kubernetes image garbage collection threshold values.

Alexander Farber
  • 21,519
  • 75
  • 241
  • 416
Rahul Khengare
  • 1,186
  • 1
  • 13
  • 15

1 Answers1

4

Changing the garbage collection thresholds can be done using switches on the kubelet.

From the docs

--image-gc-high-threshold int32    The percent of disk usage after which image garbage collection is always run. (default 85)
--image-gc-low-threshold int32     The percent of disk usage before which image garbage collection is never run. Lowest disk usage to garbage collect to. (default 80)
coreypobrien
  • 1,921
  • 17
  • 17
  • In k3s these switches go into `/etc/rancher/k3s/config.yaml` under `kubelet-arg: - "image-gc-high-threshold=74"` – Noumenon Jun 15 '23 at 15:47