amazon-ecs

AWS Scaling In Termination Protection for EC2 Container Service

本秂侑毒 提交于 2019-12-23 04:48:37
问题 I am unable to figure out how to protect my ECS task instances when using Auto Scaling in Amazon AWS. I have a long running task that can scale out as required but I want to mark task instances that are running as "not destroyable". I have found several resources that talk about instance protection such as: https://aws.amazon.com/blogs/aws/new-instance-protection-for-auto-scaling/ and (because I am using python) the API documentation is here: http://boto3.readthedocs.io/en/latest/reference

Running multiple ECS tasks based on same task definitions in one host, using different ports

血红的双手。 提交于 2019-12-22 10:56:59
问题 I have one ecs task definition. Can multiple tasks of the above task definition can run on one EC2 instance on several ports ? I have already have running several tasks running on several ec2 instances. I want to reduce the consumption of resources. As one EC2 instance has more than enough resources to run several tasks. Is it possible to run same task several times on different ports on one EC2 instance ? 回答1: Yes, ECS has very good support for this since 2016. You can leave the host port

Getting console output from Docker container

雨燕双飞 提交于 2019-12-22 06:54:39
问题 I build an image with python instaled and a python app to. My python app is a hello world, just printing "Hello World" on screen. Dockerfile: FROM python:2-onbuild CMD ["python", "./helloworld.py"] In the console i execute: docker run xxx/zzz i can see the Hello World output. Now i am tryng to execute the same app, using the task from ECS. I already pulled it to Docker Hub. How can I see the output hello world? is the anyway yo see that my container run correctly? 回答1: docker logs <container

AWS ECS Fargate pull image from a cross account ECR repo

放肆的年华 提交于 2019-12-22 06:29:10
问题 I have 2 AWS accounts: - account A that has an ECR repo. - account b that has an ECS cluster running Fargate. I have created a "cross-account" role in account A with trust relations to account B, also I have attached the "AmazonEC2ContainerRegistryPowerUser" policy to this role. I gave access to the ECR repository in account A by adding account B's id and the "cross-account" role to the repository policy. I attached a policy to the fargate "TaskExecutionRole" allowing fargate to assume the

Cloudformation KeyValuePair List as a parameter

不羁的心 提交于 2019-12-22 04:46:31
问题 When creating ECS infrastructure we describe our Task Definitions with CloudFormation. We want to be able to dynamically pass environment variables as a parameter to the template. According to the docs, Environment has a KeyValuePair type, but CloudFormation parameters do not have this type. We can not hardcode Environment variables to the template, because this template is used as a nested stack so environment variables will be dynamically passed inside it. The only possible way I see so far

Register EC2 instance to ECS cluster without public ip

為{幸葍}努か 提交于 2019-12-22 04:18:18
问题 I'm having hard times adding instances that are created in my VPC and on a private subnet(no internet gateway attached to it) to ECS cluster. Right now the only way I've managed to do this was by adding a public IP and have a NAT instance/gateway configured. How do you use ECS clusters with private subnets? 回答1: I guess I've found the answer on the AWS documentation and it seems I need to use a NAT instance/Gateway :( Another source and also the official documentaion "...Container instances

How to autoscale Servers in ECS?

寵の児 提交于 2019-12-22 04:11:09
问题 I recently started using ECS. I was able to deploy a container image in ECR and create task definition for my container with CPU/Memory limits. My use case is that each container will be a long running app (no webserver, no port mapping needed). The containers will be spawned on demand 1 at a time and deleted on demand 1 at a time. I am able to create a cluster with N server instances. But I'd like to be able for the server instances to automatically scale up/down. For example if there isn't

How to autoscale Servers in ECS?

时光怂恿深爱的人放手 提交于 2019-12-22 04:10:52
问题 I recently started using ECS. I was able to deploy a container image in ECR and create task definition for my container with CPU/Memory limits. My use case is that each container will be a long running app (no webserver, no port mapping needed). The containers will be spawned on demand 1 at a time and deleted on demand 1 at a time. I am able to create a cluster with N server instances. But I'd like to be able for the server instances to automatically scale up/down. For example if there isn't

Docker push to AWS ECR private repo failing with malformed JSON

梦想与她 提交于 2019-12-21 07:03:21
问题 I am trying out AWS ECR and pushing a new tag to our private repossitory. it goes like this: export DOCKER_REGISTRY=0123123123123.dkr.ecr.us-east-1.amazonaws.com export TAG=0.1 docker build -t vendor/app-name . `aws ecr get-login --region us-east-1`" # generates docker login docker tag vendor/app-name $DOCKER_REGISTRY/vendor/app-name:$TAG docker push $DOCKER_REGISTRY/vendor/app-name:$TAG Login works, the tag is created and I see it with docker images , but the push fails cryptically. The push

AWS ECS start multiple containers in one task definition

主宰稳场 提交于 2019-12-21 06:21:12
问题 I have docker container with one application, application runs based on input parameters, passed to entrypoint. I want to create one task definition for ECS and run multiple containers in parallel in one task definition with different input parameters for each container. The issue is - that I cannot do it without setting essential option to one of my containers in task definition. But, I do not want stop others, if my essential container finishes. All containers are independent. Possible