Set kubelet image GC thresholds below the imagefs eviction threshold by default
Feature Request
Description
Talos keeps the upstream kubelet defaults for image GC and eviction: imageGCHighThresholdPercent: 85 / imageGCLowThresholdPercent: 80, and evictionHard.imagefs.available: 15%. Both trip at 85% disk usage. Image GC checks every 5 minutes and the eviction manager every 10 seconds, so eviction always sees the crossing first. Unused images build up until the disk sits just under 85%, and the next image pull puts the node into DiskPressure with the node.kubernetes.io/disk-pressure:NoSchedule taint. The taint stays for the 5-minute evictionPressureTransitionPeriod, even though the eviction manager frees the disk within a minute.
Upstream has this as kubernetes/kubernetes#124868 (kind/bug). It was closed in January 2026 without a fix, so every distribution has to handle it itself.
I hit it on Talos v1.13.10 / Kubernetes v1.36.2. A worker sat at ~84% of /var for days, and normal image GC never ran. A routine DaemonSet image update then pushed it over:
12:29:40 eviction_manager.go:381 Eviction manager: attempting to reclaim resourceName=ephemeral-storage
12:29:41 image_gc_manager.go:460 Attempting to delete unused images
12:29:41–12:30:38 Removing image to free bytes (458 images)
12:30:38 eviction_manager.go:388 Eviction manager: able to reduce resource pressure without evicting pods./var went from 84% to 7%, but the node stayed tainted until 12:34:57. During that window, descheduler's RemovePodsViolatingNodeTaints evicted pods off a node with plenty of free disk.
Talos already overrides several kubelet defaults when the user hasn't set them (systemReserved including ephemeral-storage, shutdownGracePeriod, serializeImagePulls, streamingConnectionIdleTimeout). I'd suggest adding image GC thresholds to that list, below the eviction threshold with room for the 5-minute GC period, e.g. imageGCHighThresholdPercent: 75 and imageGCLowThresholdPercent: 65. Both are pointer fields, so they fit the existing if config.X == nil pattern in NewKubeletConfiguration, and values from machine.kubelet.extraConfig still win. A non-zero imageMaximumGCAge default (e.g. 168h) would also help on long-running nodes.
Source: siderolabs/talos