【问题标题】:Helm 3 search shows no result from ACRHelm 3 搜索显示 ACR 没有结果
【发布时间】:2021-03-09 18:55:48
【问题描述】:

问题本身

获得了一个 Azure 容器注册表作为图像和图表存储。假设myacr.azurecr.io 推送了 8 个不同的图表。据我之前阅读,Azure ACR 能够存储图表并兼容 Helm 3版本 3.5.2)。

以下重现步骤很简单。

  1. helm repo add myacr https://myacr.azurecr.io/helm/v1/repo --username myusername -password admin123 - 添加了回购。好的。
  2. helm chart save ./my-chart/ myacr.azurecr.io/helm/my-chart:1.0.0 - 图表已保存。好的
  3. helm push ./my-chart/ myacr.azurecr.io/helm/my-chart:1.0.0 - 推送。在 Azure 门户中可用。好的。
  4. helm repo update - 这里出了什么问题?正如预期的那样。好的
Hang tight while we grab the latest from your chart repositories...
...Successfully got an update from the "ingress-nginx" chart repository
...Successfully got an update from the "jetstack" chart repository
...Successfully got an update from the "myacr" chart repository
Update Complete. ⎈Happy Helming!⎈
  1. helm search repo -l - 我看到了来自ingress-nginxjetstack 的所有内容,但没有看到来自myacr 的列表。 但是,如果我这样做 pullexport 一切正常 - 图表就位

我尝试了什么

  • 根据网络上的一些理论将 repo 名称重命名为 helm/{app} - 失败
  • 重新配置带有完整描述的图表等。根据ingress-nginx - 失败
  • 执行 helm search repo -l --devel 以查看所有可能的图表版本 - 运气不好
  • “关闭再打开” - 使用不同的组合再次删除和添加 repo - 失败
  • 每次尝试都使用明确的俚语 - 有点热身,但不能解决问题

问题是

  1. Azure ACR 是否与 Helm 3 完全兼容?
  2. 是否有任何特定的解决方法可以使其与 Helm 3 兼容?
  3. 搜索功能是否对图表结构或版本有任何要求?

【问题讨论】:

  • 所以看起来helm search 从远程仓库拉取 index.yaml 文件,保存在本地(在 ~/.cache/helm/repository),并根据保存的索引进行搜索文件。看起来helm chart push 没有更新 index.yaml。从我对新的符合 OCI 的 helm repos 文档的阅读来看,它们似乎完全脱离了 index.yaml 文件。
  • 这样就可以解释为什么 helm search 不能以这种方式工作,但在您使用 az acr helm push 时工作(因为 az cli 显式地重新生成 index.yaml)。
  • 新的 helm 搜索必须检查 ~/.cache/helm/registry/cache/index.json 代替

标签: azure kubernetes kubernetes-helm azure-container-registry acr


【解决方案1】:

Azure ACR 是否与 Helm 3 完全兼容?

是的,它与 Helm 3 完全兼容。

是否有任何特定的解决方法可以使其与 Helm 3 兼容?

什么都不需要做,因为第一个问题是肯定的。

搜索功能是否对图表结构有任何要求? 版本?

您需要首先使用命令 az acr helm repo add --name myacrhelm repo add myacr https://myacr.azurecr.io/helm/v1/repo --username xxxxx --password xxxxxx 将 repo 添加到本地 helm,然后运行命令 helm search repo -l 得到类似这样的输出:

本地仓库看起来像这样:

【讨论】:

  • 我的错 - 没有提到有问题的步骤(将编辑),但我当然已经添加了 repo。在此答案删除它并使用凭据和不添加凭据之后。正是这个图表列表仍然是空的。我看到了来自ingress-nginxjetstack 的所有图表。还尝试helm search repo -l --devel 包含所有现有版本。不走运,不过还是谢谢你
  • @ArtemFomin 您如何将图表推送到 ACR?您是否使用 Azure CLI,如果图表已在其中,您是否检查 ACR?
  • 不。没有 Azure CLI。仅使用 Helm 工具。 helm save ..,然后是helm push ...,如上所述
  • @ArtemFomin 你检查图表是否在 ACR 中吗?
  • 当然。它们位于 Azure 门户中的 ACR 中,ACR 将它们识别为 Helm 图表。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-12-18
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多