Skip to content

Tags all images from ECR currently in-use inside a Kubernetes cluster with a given tag or a tag prefix

License

Notifications You must be signed in to change notification settings

AnesBenmerzoug/kube-ecr-tagger

Repository files navigation

kube-ecr-tagger

codecov

kube-ecr-tagger is a tool used to complement ECR lifecycles policies by adding a specified tag or tag prefix to all images from ECR that are currently used in your kubernetes cluster.

Docker images can be found in this Dockerhub repository.

Requirements

  • Working Kubernetes cluster
  • IAM Role to tag images on ECR with at least the following policy:
{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Effect": "Allow",
            "Action": [
                "ecr:GetAuthorizationToken",
                "ecr:BatchCheckLayerAvailability",
                "ecr:GetDownloadUrlForLayer",
                "ecr:DescribeImages",
                "ecr:BatchGetImage",
                "ecr:PutImage",
            ],
            "Resource": "*"
        }
    ]
}

Deployment

Example manifests can in the manifests folder.

It contains a ServiceAccount, ClusterRole, ClusterRoleBinding and Deployment definitions.

Development

Testing

make test

Linting

Install and run golanci-lint

make install-golangci-lint
make lint

Building

Dynamically-linked binary:

make build

Statically-linked binary:

make build-static

Docker image:

make build-image

About

Tags all images from ECR currently in-use inside a Kubernetes cluster with a given tag or a tag prefix

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published