Helm 客户端版本 3 现在支持 ECR 作为 Helms 图表存储库。虽然,目前任何基于 OCI 的注册表支持在 Helms 官方 documentation 上都被认为是实验性的。
假设您拥有所需的权限并且已经将 helm chart 推送到 ECR(如果您还没有,请遵循文档 here),您可以(可选)快速执行 aws ecr describe-images 以获取可用标签列表您在 ECR 存储库中的 helm-chart。
aws ecr describe-images --repository-name <your-repo-name> --region <region> --profile <profile>
{
"imageDetails": [
{
"registryId": "************",
"repositoryName": "<your-repo-name>",
"imageDigest": "sha256:******************************************",
"imageTags": [
"0.1.6"
],
"imageSizeInBytes": 3461,
"imagePushedAt": "2021-04-07T00:16:31+01:00",
"imageManifestMediaType": "application/vnd.oci.image.manifest.v1+json",
"artifactMediaType": "application/vnd.cncf.helm.config.v1+json"
}
]
}
获取 ECR 令牌并登录到 helm repo:
aws ecr get-login-password --region <region> | helm registry login --username AWS --password-stdin <aws_account_id>.dkr.ecr.<region>.amazonaws.com
获得所需的详细信息后,您可以运行 helm chart pull 命令从 ECR 中提取图表。
helm chart pull <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<your-repo-name>:0.1.6
0.1.6: Pulling from <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<your-repo-name>
ref: <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<your-repo-name>:0.1.6
digest: d16af8672604ebe54********************************************
size: 3.2 KiB
name: <your-chart-name>
version: 0.1.6
Status: Chart is up to date for <aws_account_id>.dkr.ecr.<region>.amazonaws.com/<your-repo-name>:0.1.6
验证:
helm chart list
REF NAME VERSION DIGEST SIZE CREATED
<aws_account_id>.dkr.ecr.<region>.amazonaws.com/<your-repo-name>... <your-chart-name> 0.1.6 50f03e4 3.2 KiB 22 second