How rolling promotions work
A rolling promotion follows a repeating three-step cycle:- Scale up candidate deployment replicas by the configured percentage.
- Shift traffic proportionally to match the new replica ratio.
- Scale down the previous deployment replicas by the same percentage.
Provisioning modes
Rolling promotions support two mutually exclusive provisioning modes. You must configure exactly one:max_surge_percent: Scales up candidate replicas before scaling down previous replicas.max_unavailable_percent: Scales down previous replicas before scaling up candidate replicas.
Enabling rolling promotions
Enable rolling promotions on any environment by updating the environment’s promotion settings. Rolling promotions are disabled by default.- cURL
- Python
Configuration reference
Configure rolling promotions through therolling_deploy_config object in the environment’s promotion_settings.
Percentage of additional replicas to provision during each step. Set to
0 to use max unavailable mode instead.Range: 0–50Percentage of replicas that can be unavailable during each step. Set to
0 to use max surge mode instead.Range: 0–50Seconds to wait after each traffic shift before proceeding to the next step. Use this to monitor metrics between steps.Range: 0–3600
Percentage of additional replicas to pre-provision on the current deployment before the promotion starts. Compensates for autoscaling being disabled.Range: 0–500
promotion_settings level:
Enables rolling promotions for the environment.
Promotion statuses
Thein_progress_promotion field on the environment detail endpoint tracks the current state of a promotion.
| Status | Description |
|---|---|
RELEASING | Candidate deployment is building and initializing replicas. |
RAMPING_UP | Scaling up candidate replicas and shifting traffic. |
PAUSED | Promotion is paused at its current traffic split. Replicas stay at their current count. |
RAMPING_DOWN | Graceful cancel in progress. Traffic is shifting back to the previous deployment. |
SUCCEEDED | Promotion completed. The candidate is now the active deployment. Autoscaling resumes. |
FAILED | Promotion failed. Traffic remains on the previous deployment. Autoscaling resumes. |
CANCELED | Promotion was canceled. Traffic returned to the previous deployment. Autoscaling resumes. |
in_progress_promotion object also includes percent_traffic_to_new_version, which reports the current percentage of traffic routed to the candidate deployment.
Promotion control actions
Pause
Pauses the promotion after the current step completes. Use this to inspect metrics or logs before proceeding.- cURL
- Python
Resume
Resumes a paused promotion from where it left off.- cURL
- Python
Cancel
Gracefully cancels the promotion. Traffic ramps back to the previous deployment and candidate replicas scale down.- cURL
- Python
status of CANCELED (instant cancel for non-rolling promotions) or RAMPING_DOWN (graceful rollback for rolling promotions).
Force cancel
Immediately cancels the promotion and returns all traffic to the previous deployment. Use this when you need to roll back without waiting for the graceful ramp-down.- cURL
- Python
Force roll forward
Immediately completes the promotion, shifting all traffic to the candidate deployment. This works even if the promotion is in the process of rolling back.- cURL
- Python
Autoscaling during promotions
To compensate for autoscaling being disabled during promotions:- Set
replica_overhead_percentto pre-provision the current deployment before the promotion starts. For example, a value of50adds 50% more replicas to the current deployment before any traffic shifts. - Set
stabilization_time_secondsto add a wait period between steps, giving you time to monitor metrics before the next traffic shift. - Factor in expected traffic when setting your environment’s
min_replicaandmax_replicabefore starting the promotion.
SUCCEEDED, FAILED, or CANCELED.
Promotion cleanup
After a promotion completes, thepromotion_cleanup_strategy setting controls what happens to the previous deployment.
SCALE_TO_ZERO: Scales the previous deployment to zero replicas. It remains available for reactivation. This is the default.KEEP: Leaves the previous deployment running at its current replica count.DEACTIVATE: Deactivates the previous deployment. It stops serving traffic and releases all resources.
- cURL
- Python