Helm - 无法从私有 Github 存储库安装依赖项

ode*_*cca 5 kubernetes-helm

我正在尝试从我使用 部署的私有存储库安装软件包chart-releases,但我无法做到。

这是我所做的:

  1. 我创建了一个新的私有存储库,向其中添加了一个示例图表并运行了以下命令:
helm package charts/* --destination .deploy
cr upload -o odelucca -r helm-charts -p .deploy -t $MY_TOKEN
Run Code Online (Sandbox Code Playgroud)
  1. 我已经index.yaml使用以下命令创建了:
cr index --config .cr.yaml -t $MY_TOKEN
# My .cr.yaml file:
# owner: odelucca
# git-repo: helm-charts
# package-path: .deploy
# index-path: index.yaml
# charts-repo: https://github.com/odelucca/helm-charts/
Run Code Online (Sandbox Code Playgroud)
  1. 我已经提交index.yaml到 repo

  2. 我使用以下命令添加了远程 helm repo:

helm repo add helm-charts https://raw.githubusercontent.com/odelucca/helm-charts/master --username $MY_EMAIL --password $MY_TOKEN
Run Code Online (Sandbox Code Playgroud)
  1. 添加了 repo,然后我将以下依赖项添加到本地图表:
dependencies:
- name: serverless-common
  version: 1.0.0
  repository: "@helm-charts"
Run Code Online (Sandbox Code Playgroud)
  1. 现在,我尝试运行以下命令:
helm dep update
Run Code Online (Sandbox Code Playgroud)
  1. 我收到以下错误:
Hang tight while we grab the latest from your chart repositories...
...Unable to get an update from the "local" chart repository (http://127.0.0.1:8879/charts):
        Get http://127.0.0.1:8879/charts/index.yaml: dial tcp 127.0.0.1:8879: connect: connection refused
...Successfully got an update from the "helm-charts" chart repository
...Successfully got an update from the "stable" chart repository
Update Complete.
Saving 1 charts
Downloading serverless-common from repo https://raw.githubusercontent.com/odelucca/helm-charts/master
Save error occurred:  could not download https://github.com/odelucca/helm-charts/releases/download/serverless-common-1.0.0/serverless-common-1.0.0.tgz: Failed to fetch https://github.com/odelucca/helm-charts/releases/download/serverless-common-1.0.0/serverless-common-1.0.0.tgz : 404 Not Found
Deleting newly downloaded charts, restoring pre-update state
Error: could not download https://github.com/odelucca/helm-charts/releases/download/serverless-common-1.0.0/serverless-common-1.0.0.tgz: Failed to fetch https://github.com/odelucca/helm-charts/releases/download/serverless-common-1.0.0/serverless-common-1.0.0.tgz : 404 Not Found
Run Code Online (Sandbox Code Playgroud)

任何人都可以帮助我吗?我尝试了很多不同的方法,但没有一个能解决它

小智 0

您是否尝试过编辑存储库配置文件?你应该有这样的东西:

vim ${HOEM}/.config/helm/repositories.yaml

apiVersion: ""
generated: "0001-01-01T00:00:00Z"
repositories:
- caFile: ""
  certFile: ""
  insecure_skip_tls_verify: false
  keyFile: ""
  name: helm-charts
  password: ""
  url: "https://raw.githubusercontent.com/odelucca/helm-charts/master"
  username: ""
Run Code Online (Sandbox Code Playgroud)

编辑它并输入您的用户名和密码以连接到您的私人注册表。

对我来说,这很好用。

也许您还需要检查您的存储库路径。

您应该能够使用如下 URL 进行下载: ${repository}/${name}-${version}.tgz