services: app: image: ghcr.io/acme/website:latest x-config: autoscale: minReplicas: 1 maxReplicas: 100 triggers: - type: cron metadata: # The acceptable values would be a value from the IANA Time Zone Database. timezone: Asia/Kolkata start: 0 6 * * * # At 6:00 AM end: 0 20 * * * # At 8:00 PM desiredReplicas: "10"
Autoscaling Triggers
CRON
Scale applications based on a cron schedule.
Copy
services: app: image: ghcr.io/acme/website:latest x-config: autoscale: minReplicas: 1 maxReplicas: 100 triggers: - type: cron metadata: # The acceptable values would be a value from the IANA Time Zone Database. timezone: Asia/Kolkata start: 0 6 * * * # At 6:00 AM end: 0 20 * * * # At 8:00 PM desiredReplicas: "10"
The CRON scaler allows you to define a time range in which you want to scale your workloads out/in.When the time window starts, it will scale from the minimum number of replicas
to the desired number of replicas based on your configuration.
Copy
services: app: image: ghcr.io/acme/website:latest x-config: autoscale: minReplicas: 1 maxReplicas: 100 triggers: - type: cron metadata: # The acceptable values would be a value from the IANA Time Zone Database. timezone: Asia/Kolkata start: 0 6 * * * # At 6:00 AM end: 0 20 * * * # At 8:00 PM desiredReplicas: "10"