amazon-ecs

AWS ECS Create Scheduled Tasks (cron) via Cloudformation

拥有回忆 提交于 2019-12-03 10:35:11
We want to create ScheduledTasks in AWS ECS via CloudFormation. Is there a programmatic way to create via boto or cloudformation? In order to define a scheduled ECS task in CloudFormation, you need to define a "AWS::Events::Rule" resource with an ECS task as a target. "TaskSchedule": { "Type": "AWS::Events::Rule", "Properties": { "Description": "dump data every workday at 10", "Name": "dump-data", "ScheduleExpression": "cron(0 10 ? * MON-FRI *)", "State": "ENABLED", "Targets": [ { "Id": "dump-data-ecs-task", "RoleArn": { "Fn::GetAtt": ["TaskSchedulerRole", "Arn"] }, "EcsParameters": {

Docker memory limit causes SLUB unable to allocate with large page cache

≡放荡痞女 提交于 2019-12-03 07:53:00
问题 Given a process that creates a large linux kernel page cache via mmap'd files, running in a docker container (cgroup) with a memory limit causes kernel slab allocation errors: Jul 18 21:29:01 ip-10-10-17-135 kernel: [186998.252395] SLUB: Unable to allocate memory on node -1 (gfp=0x2080020) Jul 18 21:29:01 ip-10-10-17-135 kernel: [186998.252402] cache: kmalloc-2048(2412:6c2c4ef2026a77599d279450517cb061545fa963ff9faab731daab2a1f672915), object size: 2048, buffer size: 2048, default order: 3,

Stop ECS cluster temporarily

三世轮回 提交于 2019-12-03 06:28:57
I want to stop EC2 instances after office hours to save costs. How can I do the same with ECS instances? Even if I stop all tasks/services, the instance is still there? Do I stop the EC2 instance directly? From EC2 Management Console Click Auto Scaling Groups from the left menu. Select the group from the list. Click edit on the details tab. Set desired property to ' 0 '. After clicking save it is all done. The Auto Scaling Group is smart enough to shut down all instances. If you have the cluster set to a minimum number of nodes with an asg. If you turn off the nodes the asg will start another

How to change instance type in AWS ECS cluster?

。_饼干妹妹 提交于 2019-12-03 06:20:58
问题 I have a cluster in AWS EC2 Container Service. When I've set it up, I used t2.micro instances because those were sufficient for development. Now I'd like to use more powerful instances, like m4.large. I would like to know whether it is possible to change the instance types only, so I don't need to recreate the whole cluster. I could not find how to do this. 回答1: Yes, this is possible. The instance types in your cluster are determined by the 'Instance Type' setting within your Launch

AWS ECS 503 Service Temporarily Unavailable while deploying

久未见 提交于 2019-12-03 05:43:51
I am using Amazon Web Services EC2 Container Service with an Application Load Balancer for my app. When I deploy a new version, I get 503 Service Temporarily Unavailable for about 2 minutes. It is a bit more than the startup time of my application. This means that I cannot do a zero-downtime deployment now. Is there a setting to not use the new tasks while they are starting up? Or what am I missing here? UPDATE: The health check numbers for the target group of the ALB are the following: Healthy threshold: 5 Unhealthy threshold: 2 Timeout: 5 seconds Interval: 30 seconds Success codes: 200 OK

AWS ECS Task Memory Hard and Soft Limits

江枫思渺然 提交于 2019-12-03 05:38:12
问题 I'm confused about the purpose of having both hard and soft memory limits for ECS task definitions. IIRC the soft limit is how much memory the scheduler reserves on an instance for the task to run, and the hard limit is how much memory a container can use before it is murdered. My issue is that if the ECS scheduler allocates tasks to instances based on the soft limit, you could have a situation where a task that is using memory above the soft limit but below the hard limit could cause the

How to translate docker-compose.yml to Dockerrun.aws.json for Django

妖精的绣舞 提交于 2019-12-03 05:06:04
I am following the instructions at https://docs.docker.com/compose/django/ to get a basic dockerized django app going. I am able to run it locally without a problem but I am having trouble to deploy it to AWS using Elastic Beanstalk. After reading here , I figured that I need to translate docker-compose.yml into Dockerrun.aws.json for it to work. The original docker-compose.yml is version: '2' services: db: image: postgres web: build: . command: python manage.py runserver 0.0.0.0:8000 volumes: - .:/code ports: - "8000:8000" depends_on: - db and here is what I translated so far {

AWS creation failed: Service already exists. (Service: AWSServiceDiscovery; Status Code: 400; Error Code: ServiceAlreadyExists; Request ID)

对着背影说爱祢 提交于 2019-12-03 03:24:48
i am new to aws and encountred some problem while trying to create a EC2 service in a ECS cluster. i was able to successfully create a brand new service (service1) in cluster1, but afterwards, i decided to delete cluster1 and create cluster2. The problem came when i try to re-create service1 in cluster2. whenever i try to add the service, i will get the following error creation failed: Service already exists. (Service: AWSServiceDiscovery; Status Code: 400; Error Code: ServiceAlreadyExists; Request ID: d854025e-ebcc-11e8-84ab-b3bac906f2ef) anyone know how to resolve this problem? i have tried

ECS Service - Automating deploy with new Docker image

江枫思渺然 提交于 2019-12-03 01:27:46
I want to automate the deployment of my application by having my ECS service launch with the latest Docker image. From what I've read, the way to deploy a new image version is as follows: Create a new task revision (after updating the image on your Docker repository). Update the service and specify the new revision. This seems to work, but I want to do this all through CLI so I can script it. #2 seems easy enough to do through the AWS CLI with update-service , but I don't see a way to do #1 without specifying the entire Task JSON all over again as with register-task-definition (my JSON will

How to verify JWT from AWS Cognito in the API backend?

独自空忆成欢 提交于 2019-12-03 00:35:40
问题 I'm building a system consisting of an Angular2 single page app and a REST API running on ECS. The API runs on .Net/Nancy, but that might well change. I would like to give Cognito a try and this is how I imagined the authentication workflow: SPA signs in user and receives a JWT SPA sends JWT to REST API with every request REST API verfies that the JWT is authentic My question is about step 3. How can my server (or rather: my stateless, auto-scaled, load-balanced Docker containers) verify that