Mirror Helm Charts to AWS ECR

I met a case to mirror existing Helm charts to another repository. It might be caused by network availability or compliance requirements.

There are multiple ways to host a Helm repository, for example, Nexus OSS Repository, Github Pages, AWS ECR and so on.

Amazon Elastic Container Registry (Amazon ECR) is a fully managed container registry that makes it easy to store, manage, share, and deploy your container images and artifacts anywhere. It's built with scale and secure. In my case I'm using this existing service to mirror the Helm charts.

I created a script to mirror existing Helm chart to AWS ECR based on the official guide in ECR doc.

For example, below code snippet mirrors eks-charts/aws-load-balancer-controller with version 1.2.7 to Amazon ECR,

1helm repo add eks-charts https://aws.github.io/eks-charts
2helm pull eks-charts/aws-load-balancer-controller --version 1.2.7
3./push-helm-chart-to-all-ecr-regions.sh aws-load-balancer-controller 1.2.7