Configure KEDA ScaledObject with a custom external scaler and cooldown period to autoscale a Kubernetes Deployment based on queue depth from an external metrics API
Deploy the KEDA external scaler gRPC server as a Kubernetes Service, implementing the IsActive, GetMetricSpec, and GetMetrics methods against the target queue or metrics API
Define a ScaledObject manifest referencing the Deployment as the scaleTargetRef and specifying the external trigger with the address of the scaler Service and any required metadata parameters
Set cooldownPeriod and pollingInterval in the ScaledObject spec to control how quickly KEDA scales down after queue drains and how frequently it polls the scaler
Configure minReplicaCount and maxReplicaCount bounds, and if the workload should scale to zero set minReplicaCount: 0 and ensure the external scaler's IsActive method correctly signals no active work
Observe the HPA object created by KEDA and verify that replica counts respond to changes in the external metric by watching scaling events
Known gotchas
When minReplicaCount is 0, KEDA manages activation separately from scaling; the IsActive method controls the 0-to-1 transition while the HPA handles 1-to-N, so a bug in IsActive can leave deployments stuck at zero even when there is pending work
The external scaler gRPC server must be reachable from within the cluster on the address specified in the ScaledObject; a DNS or port mismatch causes KEDA to log connection errors and fall back to the last known replica count rather than scaling
KEDA creates and owns the HPA object for the scaleTargetRef; manually editing or creating a competing HPA for the same Deployment causes a conflict where KEDA continuously overwrites the manual HPA configuration
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp