0

头盔版本:3.6.1

以下步骤使用 ACR 成功,添加远程图表存储库:

  1. helm repo add myrepo https://myrepo.azurecr.io/helm/v1/repo --username "..." --password "..."
  2. helm search repo myrepo--> 列出可用的图表存储库

但是,一旦我尝试安装具有相同凭据的图表:(相同的helm pull
helm install myhelmtest mytest/testchart --username "..." --password "..." --debug
它会导致:
[debug] failed to fetch https://myrepo.azurecr.io/helm/v1/repo/_blobs/testchart-0.1.0.tgz : 401 Unauthorized

我之前也尝试过helm registry login使用相同的凭据成功,但它对上述命令没有影响。

有什么建议/想法吗?

4

1 回答 1

0

您可以传递适合您的方案的注册表凭据,例如服务主体凭据或存储库范围的令牌。

例如,您可以创建一个 Azure Active Directory 服务主体,该主体对注册表具有拉取和推送权限(AcrPush 角色)。然后将服务主体凭据提供给 helm 注册表登录。以下示例使用环境变量提供密码:

echo $spPassword | helm registry login mycontainerregistry.azurecr.io \
  --username <service-principal-id> \
  --password-stdin

您还可以使用个人 Azure AD 身份登录注册表以推送和拉取 Helm 图表。

az acr login --name <acrName>

https://docs.microsoft.com/en-us/azure/container-registry/container-registry-authentication?tabs=azure-cli#individual-login-with-azure-ad

使用以下 Azure 文档对 Azure ACR Helm 存储库进行身份验证。 https://docs.microsoft.com/en-us/azure/container-registry/container-registry-helm-repos#authenticate-with-the-registry

于 2021-08-19T10:16:56.643 回答