Working with Deployment Configurations in CodeDeploy

Deployment Configurations on an AWS Lambda Compute Platform

When you deploy to an AWS Lambda compute platform, the deployment configuration specifies the way traffic is shifted to the new Lambda function versions in your application.

There are three ways traffic can shift during a deployment:

  • Canary: Traffic is shifted in two increments. You can choose from predefined canary options that specify the percentage of traffic shifted to your updated Lambda function version in the first increment and the interval, in minutes, before the remaining traffic is shifted in the second increment.

  • Linear: Traffic is shifted in equal increments with an equal number of minutes between each increment. You can choose from predefined linear options that specify the percentage of traffic shifted in each increment and the number of minutes between each increment.

  • All-at-once: All traffic is shifted from the original Lambda function to the updated Lambda function version all at once.

You can also create your own custom canary or linear deployment configuration.

Predefined Deployment Configurations for an AWS Lambda Compute Platform

The following table lists the predefined configurations available for AWS Lambda deployments.

 

Deployment Configuration Description

CodeDeployDefault.LambdaCanary10Percent5Minutes

Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed five minutes later.

CodeDeployDefault.LambdaCanary10Percent10Minutes

Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 10 minutes later.

CodeDeployDefault.LambdaCanary10Percent15Minutes

Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 15 minutes later.

CodeDeployDefault.LambdaCanary10Percent30Minutes

Shifts 10 percent of traffic in the first increment. The remaining 90 percent is deployed 30 minutes later.

CodeDeployDefault.LambdaLinear10PercentEvery1Minute

Shifts 10 percent of traffic every minute until all traffic is shifted.

CodeDeployDefault.LambdaLinear10PercentEvery2Minutes

Shifts 10 percent of traffic every two minutes until all traffic is shifted.

CodeDeployDefault.LambdaLinear10PercentEvery3Minutes

Shifts 10 percent of traffic every three minutes until all traffic is shifted.

CodeDeployDefault.LambdaLinear10PercentEvery10Minutes Shifts 10 percent of traffic every 10 minutes until all traffic is shifted.
CodeDeployDefault.LambdaAllAtOnce

Shifts all traffic to the updated Lambda functions at once.

 

 

Predefined deployment EC2 / local computing platform configuration

The following table lists the predefined deployment configuration.

 

Deployment Configuration description
CodeDeployDefault.AllAtOnce

On-premise :

A one-time attempt to revise the application to deploy as many instances. If the application is deployed to revise one or more instances, the status of the deployment will be displayed as a success . If you have not revised any instance to deploy the application, then the deployment of the entire state will be displayed as a failure . In the example contains nine instance, CodeDeployDefault.AllAtOnce disposable attempts to deploy all nine instances. If you deployed to a single instance of success, the overall success of the deployment. Only when the deployment of all nine instances of failure, it will fail.

Blue / Green deployment :

  • Deployed to alternative environments: Deploy follow the rules that apply to the deployment of CodeDeployDefault.AllAtOnce same place.

  • Reroutes traffic: traffic routed once to replace all instances of the environment. If the flow is successfully re-routed to at least one instance, the deployment is successful. If re-routed to all instances fails, the deployment fails.

CodeDeployDefault.HalfAtATime

就地部署

一次最多可部署到一半实例(小数向下取整)。如果将应用程序修订部署到至少一半实例(小数向下取整),则整个部署成功。否则,部署失败。在包含 9 个实例的示例中,一次部署到最多 4 个实例。如果成功部署到 5 个或更多实例,则整个部署成功。否则,部署失败。

蓝/绿部署

  • 部署到替换环境:遵循的部署规则与适用于就地部署的 CodeDeployDefault.HalfAtATime 相同。

  • 流量重新路由:每次将流量路由到替换环境的最多半数实例中。如果成功地重新路由到至少半数实例,则部署成功。否则,部署失败。

CodeDeployDefault.OneAtATime

就地部署

一次仅将应用程序修订部署到一个实例。

对于包含多个实例的部署组:

  • 如果已将应用程序修订部署到所有实例,则整个部署成功。此规则的例外情况是,如果无法部署到最后一个实例,则整个部署仍将成功。这是因为,CodeDeploy 仅允许通过 CodeDeployDefault.OneAtATime 配置一次使一个实例脱机。

  • 一旦应用程序修订无法部署到任何实例(但最后一个实例除外),整个部署将失败。

  • 在使用 9 个实例的示例中,将一次部署到一个实例。如果部署到前 8 个实例成功,则整体部署成功。如果部署到前 8 个实例中的任何一个实例失败,则整体部署失败。

对于仅包含一个实例的部署组,整个部署仅在成功部署到单个实例时成功.

蓝/绿部署

  • 部署到替换环境:遵循的部署规则与适用于就地部署的 CodeDeployDefault.OneAtATime 相同。

  • 流量重新路由:每次将流量路由到替换环境的一个实例中。如果流量成功地重新路由到所有替换实例,则部署成功。在第一次重新路由失败后,部署失败。此规则的例外情况是,如果最后一个实例无法注册,则整个部署仍将成功。

Guess you like

Origin www.cnblogs.com/cloudrivers/p/11628275.html