logging: trim active pod logs on constrained nodes
This commit is contained in:
parent
d9955af899
commit
e3c05095f8
@ -110,6 +110,9 @@ trim_constrained_pod_logs() {
|
|||||||
continue
|
continue
|
||||||
fi
|
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
|
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
|
if [ -d "${base}/containers" ]; then
|
||||||
find "${base}/containers" -xtype l -print -delete 2>/dev/null || true
|
find "${base}/containers" -xtype l -print -delete 2>/dev/null || true
|
||||||
fi
|
fi
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user