Custom helm chart - helm dep update fails with Error: stable/nginx-ingress chart not found in repo https://kubernetes-charts.storage.googleapis.com

Custom helm chart - helm dep update fails with Error: stable/nginx-ingress chart not found in repo https://kubernetes-charts.storage.googleapis.com

如何将 stable/nginx-ingress 添加为自定义 helm chart 的依赖项?

在为存储库尝试了几个不同的 url 之后,我仍然没有运气。

步骤

  1. 使用 helm create 创建了一个新的 helm chart 并将 Chart.yaml 编辑为
apiVersion: v2
name: acme
description: A Helm chart for Kubernetes
type: application
version: 0.1.0
appVersion: 1.16.0
icon: https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png

dependencies:
  - name: stable/nginx-ingress
    version: ~1.34
    repository: https://kubernetes-charts.storage.googleapis.com
  1. 执行了这个命令helm dep update acme

输出如下

Error: stable/nginx-ingress chart not found in repo https://kubernetes-charts.storage.googleapis.com

注意

我看过这些 Stack Overflow 问题,但答案缺乏解释:

此问题无意重复。我没有使用 Azure,我使用的是 Helm 3。

helm3 的更新图表是 ready to use

helm repo add ingress-nginx https://kubernetes.github.io/ingress-nginx
helm install my-release ingress-nginx/ingress-nginx

原创

nginx-ingress chart is not published there yet. The progress is being tracked in kubernetes/ingress-nginx#5161

如果您想使用旧图表,您需要本地图表的副本,或者发布到您自己的存储库的图表版本。对于本地文件依赖,获取当前图表的副本:

git clone https://github.com/helm/charts.git
cp -r charts/stable/nginx-ingress /path/to/acmes-parent-dir/

然后就可以使用本地目录的相对引用了:

dependencies:
- name: nginx-ingress
  version: "1.34"
  repository: "file://../nginx-ingress"