diff --git a/services/logging/scripts/node_log_rotation.sh b/services/logging/scripts/node_log_rotation.sh index 774536ce..73f4dd0f 100644 --- a/services/logging/scripts/node_log_rotation.sh +++ b/services/logging/scripts/node_log_rotation.sh @@ -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