- Newest
- Most votes
- Most comments
The issue you're experiencing is related to how Amazon ECR handles repository names and how Helm interacts with OCI-compliant registries.
- Reason for the behavior: When you try to push a Helm chart to an ECR repository with a name like "utiq/argo", ECR interprets this as two separate components: "utiq" as the repository name and "argo" as the image name. However, ECR doesn't support nested repository structures like Docker Hub does. Each repository in ECR needs to be created separately.
In your first attempt, Helm is trying to push to a repository named "argo-cd" (derived from the chart name), which doesn't exist in your ECR. This is why you're getting the "NAME_UNKNOWN" error.
In your second attempt, where you're pushing directly to the root of your ECR without specifying a repository, it's creating or using a repository named after your chart ("argo-cd" in this case), which is why it succeeds.
- How to push charts to ECR repos with the required naming convention:
To adhere to your naming convention of <project-name>/<chart-name> while pushing to ECR, you'll need to:
a) Create the repository in ECR beforehand with the full name you want to use. For example:
aws ecr create-repository --repository-name utiq/argo-cd --region eu-central-1
b) When pushing the Helm chart, use the full repository name in your command:
helm push ./charts/argo-cd-7.8.2.tgz oci://<account-id>.dkr.ecr.eu-central-1.amazonaws.com/utiq/argo-cd
By creating the repository with the full name first and then using that exact name in your helm push command, you should be able to successfully push your charts to ECR while maintaining your desired naming convention.
Remember to ensure that your IAM permissions allow you to create repositories and push images to ECR. If you encounter any permission-related issues, you may need to update your IAM policies to grant the necessary permissions for ECR operations.
Sources
Pushing a Helm chart to an Amazon ECR private repository - Amazon ECR
Pushing an image to an Amazon ECR private repository - Amazon ECR
Troubleshooting Docker commands and issues when using Amazon ECR - Amazon ECR
Relevant content
- asked 2 years ago
- AWS OFFICIALUpdated 2 years ago
