CodeDeploy ECS EC2 Blue Green timing out

0

We have an ECS environment running an EC2 cluster. When we attempt to deploy using ECS Blue Green, the installation process times out. It appears that CodeDeploy is not creating the new instance / replacement environment during the deployment. It seems to be trying to deploy to the current environment as I am seeing this error:

service <service_name> was unable to place a task because no container instance met all of its requirements. The closest matching container-instance <instance_id> has insufficient memory available. For more information, see the Troubleshooting section of the Amazon ECS Developer Guide.

I am not sure if I am missing a step or if perhaps there is an option missing on the new screens (similar to the Blue/Green deployment option not being available when creating a Service while using the new ECS screens).

asked 10 months ago295 views
1 Answer
0
Accepted Answer

Is it possible to correct the problem using the troubleshooting methods described here?
https://repost.aws/knowledge-center/ecs-container-instance-requirement-error

If the container instance doesn't have enough memory for your tasks, then reduce the amount of memory in your task definition. Or, launch more container instances in your cluster. For more information, see the Not enough memory section in Service event messages. This section is located under: service (service-name) was unable to place a task because no container instance met all of its requirements.

profile picture
EXPERT
answered 10 months ago
  • The running instance has more than enough memory and is currently running correctly. It is the "Green" instance that is not executing/starting up. The below section is an excerpt from the AWS documentation found at https://docs.aws.amazon.com/codedeploy/latest/userguide/primary-components.html#primary-components-deployment-group. It states that the current instance is replaced with a new instance. Therefore, memory of the current one should not be in play. Unless I am not understanding the statements.

    Blue/green deployment: The behavior of your deployment depends on which compute platform you use:

    Blue/green on an EC2/On-Premises compute platform: The instances in a deployment group (the original environment) are replaced by a different set of instances (the replacement environment) using these steps:

    Instances are provisioned for the replacement environment.

    The latest application revision is installed on the replacement instances.

    An optional wait time occurs for activities such as application testing and system verification.

    Instances in the replacement environment are registered with an Elastic Load Balancing load balancer, causing traffic to be rerouted to them. Instances in the original environment are deregistered and can be terminated or kept running for other uses.

  • Riku, thank you. I definitely was reading this wrong. ECS replaces the task not the instance. The server was/is large enough to contain multiple tasks, the memory issue was due to the original container instances not being stopped/removed.

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions