# ecr-cleaner

## Overview

The ECR Image Cleanup Tool addresses limitations in Amazon ECR's built-in lifecycle policies, particularly for multi-architecture images. It helps prevent repositories from hitting the 10,000 image hard limit imposed by ECR by providing more flexible and architecture-aware cleanup options.

![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.1.0](https://img.shields.io/badge/AppVersion-v0.1.0-informational?style=flat-square)

## Features

1. Supports multi-architecture image cleanup
2. Allows fine-grained control over image retention
3. Can keep a specified number of recent images for each tag
4. Manages untagged images separately
5. Provides a dry-run option to preview actions before execution

## Prerequisites

- Kubernetes 1.25+
- Helm 3.16.2+

## Installing the Chart

Install from this repository

```bash
helm repo add ecr-cleaner https://rahulinux.github.io/ecr-cleaner/
helm install --namespace ecr-cleaner --create-namespace ecr-cleaner ecr-cleaner/ecr-cleaner
```

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` |  |
| cmdFlags[0] | string | `"--dry-run"` |  |
| cmdFlags[1] | string | `"--debug"` |  |
| cmdFlags[2] | string | `"--config-file"` |  |
| cmdFlags[3] | string | `"/etc/config.yaml"` |  |
| concurrencyPolicy | string | `"Forbid"` | Do not run concurrently |
| ecrCleaner | object | `{"repositories":[]}` | Configuration for ECR cleaner job |
| failedJobsHistoryLimit | int | `5` |  |
| fullnameOverride | string | `""` |  |
| image.pullPolicy | string | `"IfNotPresent"` |  |
| image.repository | string | `"rahulinux/ecr-cleaner"` |  |
| imagePullSecrets | list | `[]` |  |
| nameOverride | string | `""` |  |
| nodeSelector | object | `{}` |  |
| podAnnotations | object | `{}` |  |
| podLabels | object | `{}` |  |
| podSecurityContext | object | `{}` |  |
| resources.limits.cpu | string | `"100m"` |  |
| resources.limits.memory | string | `"256Mi"` |  |
| resources.requests.cpu | string | `"100m"` |  |
| resources.requests.memory | string | `"256Mi"` |  |
| restartPolicy | string | `"OnFailure"` |  |
| schedule | string | `"0 0 * * *"` | schedule to run every midnight |
| securityContext | object | `{}` |  |
| serviceAccount.annotations | object | `{}` |  |
| serviceAccount.automount | bool | `true` |  |
| serviceAccount.create | bool | `false` |  |
| serviceAccount.name | string | `""` |  |
| tolerations | list | `[]` |  |
| volumeMounts[0].mountPath | string | `"/etc/config.yaml"` |  |
| volumeMounts[0].name | string | `"config"` |  |
| volumes[0].configMap.name | string | `"ecr-cleaner-config"` |  |
| volumes[0].name | string | `"config"` |  |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
