immich: HPA for machine-learning
ci/woodpecker/manual/deploy-infrastructure Pipeline failed

Bursty CPU profile (library scans, facial recognition, smart search
queries) that idles between. Cache PVC is RWX, so multi-replica is
safe. Cap at 2 to limit aggregate model RAM. Slow scale rates and
long scaleDown stabilization (10m) avoid churning the model cache,
which takes ~30s of cold-start to rebuild.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-14 20:36:22 +02:00
co-authored by Claude Opus 4.7
parent cdf06b9a77
commit 976d8b4dca
@@ -70,3 +70,36 @@ spec:
ports:
- port: 3003
targetPort: http
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: immich-machine-learning
namespace: immich
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: immich-machine-learning
minReplicas: 1
maxReplicas: 2
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
behavior:
scaleUp:
stabilizationWindowSeconds: 0
policies:
- type: Pods
value: 1
periodSeconds: 120
scaleDown:
stabilizationWindowSeconds: 600
policies:
- type: Pods
value: 1
periodSeconds: 300