Schedule Kubernetes HPA using KEDA’s Cron trigger to automatically adjust replica counts at specific times for efficient resource management.
Schedule Kubernetes Horizontal Pod Autoscaling (HPA) using KEDA’s Cron trigger to automatically adjust replica counts at specific times. This approach helps you:
Define start and end times with standard CRON expressions.
Set a desiredReplicas count for the active window.
When the clock matches your start expression, KEDA scales the target Deployment up to desiredReplicas. After the end expression, it scales back down (respecting your minReplicaCount).
Below is a full example combining the Cron trigger with a Deployment target. It scales my-deployment up to 10 replicas between 06:00 and 20:00 Asia/Kolkata time, then scales down to zero after a 5 minute cooldown.
With this configuration, KEDA automatically aligns your application’s capacity to match scheduled demand patterns, improving performance and cost efficiency.