- Newest
- Most votes
- Most comments
Yes, it is possible to pull OCI artifacts like Helm charts across different AWS accounts or organizations. To achieve this, you'll need to follow a few key steps:
-
Set up cross-account access: First, you need to create an IAM policy in the account hosting the ECR repository that allows the secondary account to perform the necessary API calls against the repository.
-
Authenticate to the ECR registry: In the secondary account, you'll need to authenticate your Helm client to the ECR registry hosting the charts. You can do this using the AWS CLI and Helm commands:
aws ecr get-login-password --region [region] | helm registry login --username AWS --password-stdin [account-id].dkr.ecr.[region].amazonaws.com
Replace [region] with the appropriate AWS region and [account-id] with the ID of the account hosting the ECR repository.
-
Pull the Helm chart: Once authenticated, you can pull the Helm chart from the ECR repository in the primary account using the helm pull command:
helm pull oci://[account-id].dkr.ecr.[region].amazonaws.com/[repository-name]/[chart-name] --version [chart-version]
-
Push to new repository: After pulling the chart, you can push it to a new ECR repository in your environment using the helm push command:
helm push [chart-name]-[version].tgz oci://[your-account-id].dkr.ecr.[region].amazonaws.com/[new-repository-name]
Remember that you'll need to ensure proper permissions are set up in both accounts to allow these operations. Also, make sure you're using a recent version of Helm that supports OCI artifacts and the ECR registry format.
By following these steps, you can effectively reuse Helm charts from one ECR repository and create a separate Helm chart repository for a different environment, even across different AWS accounts or organizations.
Sources
How to pull ECR images to cross / organizational accounts? | AWS re:Post
Pushing a Helm chart to an Amazon ECR private repository - Amazon ECR
Installing a Helm chart on an Amazon EKS cluster - Amazon ECR
Relevant content
asked 3 years ago
asked 3 years ago
- AWS OFFICIALUpdated 6 months ago
