Interview Prep/Helm/Release Lifecycle, Repositories & OCI

How do you push a chart to Amazon ECR?

IntermediateConceptRelease Lifecycle, Repositories & OCI
Answer
export AWS_REGION=ap-south-1 ACCOUNT=123456789012
REG=$ACCOUNT.dkr.ecr.$AWS_REGION.amazonaws.com
aws ecr create-repository --repository-name charts/shop --region $AWS_REGION
aws ecr get-login-password --region $AWS_REGION | helm registry login --username AWS --password-stdin $REG
helm package ./shop --version 1.4.0 --app-version 2.3.0
helm push shop-1.4.0.tgz oci://$REG/charts
# Pushed: 123456789012.dkr.ecr.ap-south-1.amazonaws.com/charts/shop:1.4.0
helm install shop oci://$REG/charts/shop --version 1.4.0 -n shop --create-namespace

The ECR repository name is the push path plus the chart name (charts/shop) and must exist first. Enable tag immutability on it.

All Helm questions Roadmap: Helm

More on Release Lifecycle, Repositories & OCI