Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Kubernetes GC detect disk usage?

Tags:

kubernetes

I have a Kubernetes node with a small root disk and a large disk plumbed into /var/lib/docker

Kubernetes does GC on disk images when the used space reaches X%. Whats it looking at though? I can't find it in the docs.

Just to clarify, if you've got / with 20GB of space and /var/lib/docker with a second disk of 100GB, if K8S looks a / the % free is much less, potentially than /var/lib/docker, but / doesn't change much where as the mapped in drive, does.

like image 647
magicaltrout Avatar asked Jan 19 '26 17:01

magicaltrout


1 Answers

Configuration info for kubelet cleanup of unused images and containers is here:

https://kubernetes.io/docs/concepts/cluster-administration/kubelet-garbage-collection/

Default for X% in the question is 90%; default cleanup target is 80%.

like image 141
Jonah Benton Avatar answered Jan 21 '26 07:01

Jonah Benton