amazon-ecs

What will happen after the maximum number of images pushed to ECR repository

耗尽温柔 提交于 2019-12-05 13:01:47
According to Amazon ECR Service Limits , the maximum number of images per repository is 1,000. After exceeding this limit, the oldest image won't remove automatically. It blocks pushing to the repository. So I have to clean old images manually. Update: AWS introduced ECR Lifecycle Policies . We can now automate the cleanup with this. Having experienced this exact scenario, I can confirm that upon reaching the limit, AWS will block you from pushing with this very unhelpful error message: Error pushing to registry: Server error: 403 trying to push <repo>:<label> manifest You'll need to manage

Kubernetes pull private external amazon ECR images

时间秒杀一切 提交于 2019-12-05 10:33:35
问题 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 回答1: Since you already have

AWS ECR GetAuthorizationToken

我怕爱的太早我们不能终老 提交于 2019-12-05 08:48:23
问题 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 ? 回答1: You

Register EC2 instance to ECS cluster without public ip

只谈情不闲聊 提交于 2019-12-05 02:41:58
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? Ionut 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 need external network access to communicate with the Amazon ECS service endpoint, so if your container

STOPPED (CannotPullContainerError: API error (500)?

时光毁灭记忆、已成空白 提交于 2019-12-04 23:09:36
I'm getting this error when running a task on my Amazon Fargate cluster. Has anyone seen run into this before? Public IP is mandatory for Farget. For details https://github.com/aws/amazon-ecs-agent/issues/1128 Go to the docs for an answer to this one. https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_cannot_pull_image.html Since you are encountering a 500 error, I would heed the advice of the first error's description, "Connection timed out": When a Fargate task is launched, its elastic network interface requires a route to the internet to pull container images. If you receive

Configure amazon-ecs slave plugin using Groovy on Jenkins

ぃ、小莉子 提交于 2019-12-04 12:58:32
I'm trying to configure amazon-ecs-plugin for Jenkins using init.groovy script, but couldn't find and docs on it. I'm new to groovy based configuration automation Tried to get all the properties using import jenkins.model.* import com.cloudbees.jenkins.plugins.amazonecs.* ECSCloud.metaClass.properties.each {println it.name+":\t"+it.type } The Output: regionName: class java.lang.String searchName: class java.lang.String slaveTimoutInSeconds: int searchIndex: interface hudson.search.SearchIndex ACL: class hudson.security.ACL descriptor: class hudson.model.Descriptor credentialsId: class java

Stop ECS cluster temporarily

流过昼夜 提交于 2019-12-04 10:17:41
问题 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? 回答1: 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. 回答2: If you

Private docker registry authentication in aws ecs optimized AMI is not successful

一笑奈何 提交于 2019-12-04 10:06:52
I am writing a terraform script for creating a ECS auto scaling cluster. I have created a cluster and added ec2 container instances in to it.My task definition file contains a image that is from a Private docker repository.I go through the aws official documentation and find a page for Private Registry Authentication and tried both of the ways as described there. using dockercfg the docker way I put my ecs.config file in the S3 bucket and during the instance boot time I passed the user data as #!/bin/bash yum install -y aws-cli aws s3 cp s3://<my_bucket_name>/ecs.config /etc/ecs/ecs.config In

HOWTO deploy a docker container on aws without using elastic beanstalk or ec2 container service

流过昼夜 提交于 2019-12-04 09:39:44
问题 I'd like to use docker containers without having to use elastic beanstalk or ec2 container service. I'd like to upload a .zip file describing the container (like you do with elastic beanstalk) and have a generic ec2 instance run it using docker. When looking into the user data section of a beanstalk-created ec2 instance running a docker container, I see a cloud-init script that downloads a big shell script that does all the setup (Example). I assume that everything that elastic beanstalk does

How to debug failed fargate task initialization

梦想与她 提交于 2019-12-04 09:19:41
I have a fargate task which I have scheduled to run with CloudWatch Event rules, and output a timestamp to a database on a successful run. It also outputs a logfile to CloudWatch for every time it runs. However, there was 1 time where the log file was not created, and the database not updated. I suspect the task was never even started, or had failed to start. In CloudWatch, the event rule shows trigger and invocation at the time I expected the task to run, so I assume the task at least attempted to start. My question is: is there any way I can debug or log information about the cluster failing