right-size memory: set requests=limits based on actual usage

- Set memory requests = limits across 56 stacks to prevent overcommit
- Right-sized limits based on actual pod usage (2x actual, rounded up)
- Scaled down trading-bot (replicas=0) to free memory
- Fixed OOMKilled services: forgejo, dawarich, health, meshcentral,
  paperless-ngx, vault auto-unseal, rybbit, whisper, openclaw, clickhouse
- Added startup+liveness probes to calibre-web
- Bumped inotify limits on nodes 2,3 (max_user_instances 128->8192)

Post node2 OOM incident (2026-03-14). Previous kubelet config had no
kubeReserved/systemReserved set, allowing pods to starve the kernel.
This commit is contained in:
Viktor Barzin 2026-03-14 21:01:24 +00:00 committed by Viktor Barzin
parent 41131e58ba
commit 60173ac35c
58 changed files with 123 additions and 121 deletions

View file

@ -145,7 +145,8 @@ resource "kubernetes_deployment" "trading-bot-frontend" {
}
}
spec {
replicas = 1
# Disabled: reduce cluster memory pressure (2026-03-14 OOM incident)
replicas = 0
strategy {
type = "RollingUpdate"
rolling_update {
@ -176,10 +177,10 @@ resource "kubernetes_deployment" "trading-bot-frontend" {
resources {
requests = {
cpu = "10m"
memory = "32Mi"
memory = "64Mi"
}
limits = {
memory = "128Mi"
memory = "64Mi"
}
}
}
@ -205,7 +206,7 @@ resource "kubernetes_deployment" "trading-bot-frontend" {
memory = "128Mi"
}
limits = {
memory = "512Mi"
memory = "128Mi"
}
}
}
@ -232,7 +233,8 @@ resource "kubernetes_deployment" "trading-bot-workers" {
}
}
spec {
replicas = 1
# Disabled: reduce cluster memory pressure (2026-03-14 OOM incident)
replicas = 0
strategy {
type = "Recreate"
}
@ -270,7 +272,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "64Mi"
}
limits = {
memory = "256Mi"
memory = "64Mi"
}
}
}
@ -296,7 +298,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "512Mi"
}
limits = {
memory = "2Gi"
memory = "512Mi"
}
}
}
@ -322,7 +324,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "64Mi"
}
limits = {
memory = "256Mi"
memory = "64Mi"
}
}
}
@ -348,7 +350,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "64Mi"
}
limits = {
memory = "256Mi"
memory = "64Mi"
}
}
}
@ -374,7 +376,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "64Mi"
}
limits = {
memory = "256Mi"
memory = "64Mi"
}
}
}
@ -400,7 +402,7 @@ resource "kubernetes_deployment" "trading-bot-workers" {
memory = "64Mi"
}
limits = {
memory = "256Mi"
memory = "64Mi"
}
}
}