move Frigate cache to tmpfs to eliminate disk writes on node1

Add 512Mi tmpfs emptyDir for /tmp/cache — Frigate writes 10s MP4
segments here continuously for all cameras. With motion-only retention,
segments without events are deleted immediately anyway, so losing them
on pod restart is acceptable.

Node1 disk writes: 3.55 MB/s → 2.08 MB/s (previous commit) → 96 KB/s (now)
This commit is contained in:
Viktor Barzin 2026-03-23 11:52:49 +02:00
parent 2855da2a3c
commit 0b595751c5

View file

@ -127,6 +127,10 @@ resource "kubernetes_deployment" "frigate" {
name = "media"
mount_path = "/media/frigate"
}
volume_mount {
name = "cache-tmpfs"
mount_path = "/tmp/cache"
}
# Restart pod if GPU becomes unavailable, Frigate hangs, or
# detector falls back to CPU (inference time spikes from ~20ms to 200ms+)
liveness_probe {
@ -184,6 +188,13 @@ for name, det in stats.get('detectors', {}).items():
claim_name = module.nfs_media.claim_name
}
}
volume {
name = "cache-tmpfs"
empty_dir {
medium = "Memory"
size_limit = "512Mi"
}
}
volume {
name = "dri"
host_path {