diff --git a/backup/backup-k8s-apps.sh b/backup/backup-k8s-apps.sh index 7b059ce..b029442 100755 --- a/backup/backup-k8s-apps.sh +++ b/backup/backup-k8s-apps.sh @@ -156,8 +156,14 @@ check_resources() { # management-platform pod's minimal image, /proc/meminfo always is. avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo) avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}') - if [ "$avail_mb" -lt 1536 ]; then - echo " ❌ RAM available ${avail_mb}MB < 1536MB threshold — aborting." + # Threshold lowered 1536->1024MB 2026-08-21: this host's steady-state + # available RAM sits ~1.3-1.5GB even when idle (k3s + Jenkins + Docker + # monitoring/wazuh stack + dev tooling baseline) — investigated, no + # single runaway process, just genuine multi-service baseline. 1536MB + # was tripping on ordinary single-app backups. 1024MB still leaves + # real headroom above what a pg_dump/mysqldump/tar op actually needs. + if [ "$avail_mb" -lt 1024 ]; then + echo " ❌ RAM available ${avail_mb}MB < 1024MB threshold — aborting." log_status "FAILED" "$BACKUP_NAME" "resource_safety_ram_${avail_mb}mb" exit 1 fi diff --git a/backup/restore-k8s-apps.sh b/backup/restore-k8s-apps.sh index 21e2bc4..33d8535 100755 --- a/backup/restore-k8s-apps.sh +++ b/backup/restore-k8s-apps.sh @@ -122,7 +122,10 @@ check_resources() { # management-platform pod's minimal image, /proc/meminfo always is. avail_mb=$(awk '/^MemAvailable:/{printf "%d", $2/1024}' /proc/meminfo) avail_gb=$(df -BG / | awk 'NR==2{gsub("G","",$4); print $4}') - if [ "$avail_mb" -lt 1536 ] || [ "$avail_gb" -lt 10 ]; then + # Threshold lowered 1536->1024MB 2026-08-21 — see backup-k8s-apps.sh + # check_resources() comment for the investigation (baseline host RAM, + # not a leak). + if [ "$avail_mb" -lt 1024 ] || [ "$avail_gb" -lt 10 ]; then echo " ❌ Resource safety threshold hit (RAM=${avail_mb}MB, Disk=${avail_gb}GB) — aborting." exit 1 fi