amazon-ecs

Docker Nginx stopped: [emerg] 1#1: host not found in upstream

一曲冷凌霜 提交于 2019-12-04 08:05:49
问题 I am running docker-nginx on ECS server. My nginx service is suddenly stopped because the proxy_path of one of the servers got unreachable. The error is as follows: [emerg] 1#1: host not found in upstream "dev-example.io" in /etc/nginx/conf.d/default.conf:988 My config file is as below: server { listen 80; server_name test.com; location / { proxy_pass http://dev-exapmle.io:5016/; proxy_redirect off; ##proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X

Dynamic ports and AWS Applocation Load balancer and ECS

被刻印的时光 ゝ 提交于 2019-12-04 06:58:29
问题 Docker containers behind ELB get dynamic ports which are auto registered with ELB so that they can get traffic redirected to them. In order to make your web servers accessible to ELB you have to open all these ports 1024 - 65535 originating from within your security group. Is there a way to not to have to open up a security group to a range of port but only to the pots that ELB is using? 回答1: Security groups are never modified by AWS as this might cause conflicts and security issues. The only

How do I use insecure docker registries with Amazon EC2 Container Service (ECS)?

青春壹個敷衍的年華 提交于 2019-12-04 04:06:58
We use a Docker registry inside our AWS VPC that is not accessible externally. We want to be able to launch tasks in ECS from this registry, however we see that the service is only ever at a PENDING state because the Docker daemon isn't able to access the registry. I have found a sort of workaround by changing the launch configuration's user data but it doesn't feel like I'm doing this the best way: #!/bin/bash echo ECS_CLUSTER=MY_CLUSTER_NAME >> /etc/ecs/ecs.config echo OPTIONS=--insecure-registry=insecure.registry.hostname:5000 > /etc/sysconfig/docker service docker restart docker start ecs

Missing log lines when writing to cloudwatch from ECS Docker containers

只谈情不闲聊 提交于 2019-12-04 04:03:18
(Docker container on AWS-ECS exits before all the logs are printed to CloudWatch Logs) Why are some streams of a CloudWatch Logs Group incomplete (i.e., the Fargate Docker Container exits successfully but the logs stop being updated abruptly)? Seeing this intermittently, in almost all log groups, however, not on every log stream/task run. I'm running on version 1.3.0 Description: A Dockerfile runs node.js or Python scripts using the CMD command. These are not servers/long-running processes, and my use case requires the containers to exit when the task completes. Sample Dockerfile: FROM node:6

Kubernetes pull private external amazon ECR images

混江龙づ霸主 提交于 2019-12-03 23:09:20
I have an Amazon account with a K8S cluster which is able to pull images from the same account's ECR repository. But, my company have another account with another ECR repository. How can I pull image from this "external" ECR repository ? I'am also a Rancher user and I used to do this by installing a special container ( https://github.com/rancher/rancher-ecr-credentials ) which does the job. Is there something equivalent for Kubernetes? Thanks for your precious help Since you already have this setup for pulling images from the same account, you can do this with IAM policy level or ECR

AWS ECR GetAuthorizationToken

邮差的信 提交于 2019-12-03 22:11:06
I've tried to follow AWS instructions on setting ECR authorization to my user by giving the AmazonEC2ContainerRegistryFullAccess policy to my user. However when I try to run on my PC the aws ecr get-login I get an error that I don't have permission. An error occurred (AccessDeniedException) when calling the GetAuthorizationToken operation: User: arn:aws:iam::ACCOUNT_NUMBER:user/MY_USER is not authorized to perform: ecr:GetAuthorizationToken on resource: * What have I done wrong ? You must attach a policy to your IAM role. I attached AmazonEC2ContainerRegistryFullAccess and it worked. I've

How to force AWS ECS migrate containers to another ASG?

自闭症网瘾萝莉.ら 提交于 2019-12-03 21:53:01
问题 I'm using user_data to do initial configuration of the hosts used in ECS to run containers. I want to be able to tell AWS ECS to migrate containers to a newly created hosts once I update user_data. How can I do that? I'm using Terraform for AWS infrastructure deployments. 回答1: I don't think ECS has a built-in way to do this. As a result, it usually requires a fairly tedious & manual process (albeit one that could be scripted). There are a few different ways to do it, but this is typically the

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

ぃ、小莉子 提交于 2019-12-03 14:09:22
问题 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;

creating a 'Target' for a cloudwatch event rule via cloudformation for a fargate launchtype task

混江龙づ霸主 提交于 2019-12-03 13:12:20
问题 I'm trying to create a scheduled task (CloudWatch Events Rule) in my CloudFormation Template that would have the following EcsParameters: EcsParameters: LaunchType: FARGATE NetworkConfiguration: AwsVpcConfiguration: AssignPublicIp: !Ref PublicIpAssignment SecurityGroups: - !Ref EcsSecurityGroups Subnets: - !Ref SubnetName TaskCount: 1 TaskDefinitionArn: !Ref TaskDefinitionOne My ECS CLuster is launched on Fargate and not EC2, and I do NOT have a service running (use case doesn't need a long

What is the minimum healthy percent and maximum percent in Amazon ECS

爱⌒轻易说出口 提交于 2019-12-03 11:35:22
问题 I already have the experience in Docker and EC2. But I'm new to ECS. Can someone help me to understand what these two parameters actually does, their difference and usage. Official Docs says: The minimum healthy percent represents a lower limit on the number of your service's tasks that must remain in the RUNNING state during a deployment, as a percentage of the desired number of tasks (rounded up to the nearest integer). This parameter enables you to deploy without using additional cluster