# Horizontal pod autoscalers for the three load-responsive Deployments. # prop-backfill is deliberately excluded — it's a single-replica catch-up # worker that's bottlenecked on IEM rate-limit waits rather than CPU, so # scaling by CPU would just add idle replicas parked on 429 backoffs. # # CPU targets use AverageValue (absolute cores) rather than Utilization # (% of request) so the scale-up thresholds don't depend on the request # number. Request fields in the Deployments can be tuned independently # for scheduler bin-packing without accidentally changing when HPA # decides to add a replica. # # The corresponding Deployments have their `spec.replicas` removed so # Flux's periodic reconcile doesn't fight HPA's live scaling. --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: prop namespace: prop spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: prop minReplicas: 2 maxReplicas: 5 metrics: - type: Resource resource: name: cpu target: # Average of 800m across pods triggers scale-up. The hourly # :05 propagation chain + ScoreCache warming on one pod can # peak near 2 cores — averaging across 2–3 replicas keeps the # threshold meaningful without flapping on every cron tick. type: AverageValue averageValue: 800m behavior: scaleUp: # React quickly to sudden surges (LiveView + propagation chain # can coincide). Add up to 2 pods or 100% of current replica # count per 30 s window, whichever is larger. stabilizationWindowSeconds: 30 policies: - type: Pods value: 2 periodSeconds: 30 - type: Percent value: 100 periodSeconds: 30 selectPolicy: Max scaleDown: # Slower scale-down so the hourly chain doesn't immediately # trigger a churn of terminations five minutes later. stabilizationWindowSeconds: 600 policies: - type: Pods value: 1 periodSeconds: 120 --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: prop-grid-rs namespace: prop spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: prop-grid-rs minReplicas: 1 maxReplicas: 4 metrics: - type: Resource resource: name: cpu target: type: AverageValue averageValue: 400m behavior: scaleUp: stabilizationWindowSeconds: 30 policies: - type: Pods value: 1 periodSeconds: 30 scaleDown: stabilizationWindowSeconds: 600 policies: - type: Pods value: 1 periodSeconds: 120 --- apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: hrrr-point-rs namespace: prop spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: hrrr-point-rs minReplicas: 1 maxReplicas: 4 metrics: - type: Resource resource: name: cpu target: type: AverageValue averageValue: 400m behavior: scaleUp: stabilizationWindowSeconds: 30 policies: - type: Pods value: 1 periodSeconds: 30 scaleDown: stabilizationWindowSeconds: 600 policies: - type: Pods value: 1 periodSeconds: 120