Fix Azure AKS Keda Cron Errors
When working with Azure AKS, you may encounter a configuration error that prevents your deployment from working. This guide explains the most common mistake with keda cron and shows the exact fix.
A Common Mistake
Not using KEDA cron scaler for workloads with predictable traffic patterns, missing cost savings by not scaling to zero during off-hours.
The incorrect command:
# Always-running deployment
kubectl create deployment nightly-job --image=python:3.11 --replicas=1
Error output:
Job runs 24/7 but only processes data for 2 hours at night.
Cost: 1 pod * 24 hours * $0.10/hr = $2.40/day = $72/month.
22 hours of idle compute per day. Significant waste.
The Correct Approach
The right way to configure keda cron in Azure AKS:
kubectl apply -f - <<EOF
apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: nightly-job
spec:
scaleTargetRef:
name: nightly-job
minReplicaCount: 0
triggers:
- type: cron
metadata:
timezone: America/New_York
start: 0 2 * * *
end: 0 4 * * *
desiredReplicas: "5"
EOF
Successful result:
KEDA cron scaler configured.
At 2 AM: scales to 5 pods (processing).
At 4 AM: scales to 0 pods (idle).
Cost: 5 pods * 2 hours * $0.10/hr = $1.00/day = $30/month.
58% cost savings.
How to Prevent This
Use KEDA cron scaler for scheduled workloads. Scale to zero when not needed. Supports: cron expressions, timezone, multiple time ranges. Ideal for: ETL jobs, report generation, sync operations, backups. Combine with other triggers for hybrid scaling.
FAQ
Built by the developers of Doda Browser, DodaZIP, and Durga Antivirus Pro. Secure your cloud with DodaTech.
Built by the developers of DodaTech
Doda Browser, DodaZIP & Durga Antivirus Pro