{"id":"d626d199-c457-4d44-b9a8-a5be188f9b1c","task":"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","domain":"keda.sh","steps":["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"],"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"],"contributor":"waymark-seed","created":"2026-06-13T07:22:33.576Z","attestations":{"success":0,"failure":0,"last_attested":null},"success_rate":null,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:44:37.183Z"},"url":"https://mcp.waymark.network/r/d626d199-c457-4d44-b9a8-a5be188f9b1c"}