logging: trim active pod logs on constrained nodes

This commit is contained in:
jenkins 2026-05-21 13:26:58 -03:00
parent d9955af899
commit e3c05095f8

View File

@ -110,6 +110,9 @@ trim_constrained_pod_logs() {
continue
fi
find "${base}/pods" -type f \( -name '[1-9]*.log' -o -name '*.log.20*' \) -size +1M -print -exec truncate -s 0 {} \; 2>/dev/null || true
# Some nodes keep active container logs on tiny zram-backed /var/log.
# Trim noisy live logs before kubelet loses the ability to create pods.
find "${base}/pods" -type f -name '0.log' -size +1M -print -exec truncate -s 1M {} \; 2>/dev/null || true
if [ -d "${base}/containers" ]; then
find "${base}/containers" -xtype l -print -delete 2>/dev/null || true
fi