英文:
EC2 instance keeps getting started by ECS ContainerService
问题
I am trying to deploy a docker image with ECS, EC2.
The first part, pushing my docker image to ECR, was smooth sailing.
Then, I created one Task and one ECS cluster. My Task was set to use EC2 with 800Mb memory requirement and 1 vCPU, and I also entered my docker ECR container uri. After creating, an EC2 instance was created and it was working!
But then, my nightmare began. I wanted to shut this ECS cluster/task and its EC2 down. So, I went to the ECS console and deleted my Cluster and then deregistered my Task. I went to EC2 console and terminated its instance. But after a few minutes, the EC2 that I just terminated respawned! For two hours, I tried repeatedly to terminate this EC2 instance but the demonic EC2 instance kept respawning!
The last thing I tried: I found the delete feature on the Task page on ECS and deleted the Task, but this still did not work!
Here is an snippet of the EC2 instance I kept on terminating.
Please help. I am at my wits end.
- What is the proper way of terminating an ECS cluster and task? Did I do something wrong?
- Has anyone experienced EC2 Instances being recreated even after the Task is deleted?!
- Any advice here?
英文:
I am trying to deploy a docker image with ECS, EC2.
The first part, pushing my docker image to ECR, was smooth sailing.
Then, I created one Task and one ECS cluster. My Task was set to use EC2 with 800Mb memory requirement and 1 vCPU, and I also entered my docker ECR container uri. After creating, an EC2 instance was created and it was working!
But then, my nightmare began. I wanted to shut this ECS cluster/task and its EC2 down. So, I went to the ECS console and deleted my Cluster and then deregistered my Task. I went to EC2 console and terminated its instance. But after a few minutes, the EC2 that I just terminated respawned! For two hours, I tried repeatedly to terminate this EC2 instance but the demonic EC2 instance kept respawning!
The last thing I tried: I found the delete feature on the Task page on ECS and deleted the Task, but this still did not work!
Here is an snippet of the EC2 instance I kept on terminating.
Please help. I am at my wits end.
- What is the proper way of terminating a ECS cluster and task? Did I do
something wrong? - Has anyone experienced EC2 Instances being recreated even after the Task is deleted?!
- Any advice here?
答案1
得分: 1
I have found another question on Stackoverflow that answered my problem! It was nothing got to do with ECS. It was because of the Autoscaling groups that was somehow created by ECS.
Thank you!
A copy of @Michael - sqlbot's answer
Note
If your instance is maintained by an Auto Scaling group or AWS
CloudFormation stack, terminate the instance by updating the Auto
Scaling group or AWS CloudFormation stack; otherwise, the Auto Scaling
group will recreate the instance after you terminate it.http://docs.aws.amazon.com/AmazonECS/latest/developerguide/deregister_container_instance.html
Auto Scaling groups can be found in the the EC2 console navigation
pane: under Auto Scaling, click Auto Scaling Group.
英文:
I have found another question on Stackoverflow that answered my problem! It was nothing got to do with ECS. It was because of the Autoscaling groups that was somehow created by ECS.
Thank you!
A copy of @Michael - sqlbot's answer
> > Note
> >
> > If your instance is maintained by an Auto Scaling group or AWS
> > CloudFormation stack, terminate the instance by updating the Auto
> > Scaling group or AWS CloudFormation stack; otherwise, the Auto Scaling
> > group will recreate the instance after you terminate it.
>
> http://docs.aws.amazon.com/AmazonECS/latest/developerguide/deregister_container_instance.html
>
> Auto Scaling groups can be found in the the EC2 console navigation
> pane: under Auto Scaling, click Auto Scaling Group.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论