【问题标题】:How to add github private repo to my Helm environment如何将 github 私有仓库添加到我的 Helm 环境
【发布时间】:2020-04-22 13:57:00
【问题描述】:

我有一个 github 私人仓库(包含有效的 index.yaml 文件),我想在不使用 github token 的情况下将它添加到我的本地 helm 环境中,但我可以使用我的 gihub凭据。我尝试过类似

helm repo add <reponame> --username <username> --password xxxx https://<username>.github.io/reponame

错误信息

错误:看起来“https://username.github.io/reponame”不是 有效的图表存储库或无法访问:无法获取 https://username.github.io/reponame/index.yaml:404 未找到

但即使没有传递我的 github 帐户的凭据,上述命令也可以与公共 repo 一起使用 我也尝试过使用https://raw.githubusercontent.com/username/reponame/branch 原始网址,但错误仍然存​​在。

【问题讨论】:

    标签: github kubernetes-helm


    【解决方案1】:

    https://&lt;username&gt;.github.io/reponame 看起来像 GitHub page URL,您可以将其与 fluxcd/helm-operator-get-started issue 28 进行比较。
    它指向valid chart side

    它的存储库包括relevant yaml files

    在“Using a private github repo as helm chart repo (https access)”之后,使用令牌似乎是强制性的。
    如果您激活了 2FA,那肯定是这样。

    OP Pycoder 确认in the comments

    我可以:

    • 在 URL 中传递个人访问令牌
      'https://&lt;token&gt;@raw.githubusercontent.com/&lt;username&gt;/&lt;reponame&gt;/master/',
    • 或在密码标志中传递令牌
      helm add repo --username &lt;username&gt; --password &lt;token&gt; url

    【讨论】:

    • 我尝试过但甚至没有为 github 公共存储库工作。 Error: Looks like "https://github.com/&lt;username&gt;/&lt;reponame&gt;" is not a valid chart repository or cannot be reached: Failed to fetch https://github.com/&lt;username&gt;/&lt;repo name&gt;/index.yaml : 404 Not Found 出现错误。
    • @Pycoder 我已经重写了答案。您的 GitHub 帐户是否激活了 2FA(2 因素身份验证)?
    • 感谢您提供宝贵的信息。我的 GitHub 帐户中没有激活 2FA。我知道我可以使用个人访问令牌将 GitHub 私有仓库(它应该有一个有效的 index.yaml)添加到我的 Helm 环境中。但我的问题是,是否可以使用 GitHub 用户名和密码(不使用 GitHub 个人访问令牌)做同样的事情。
    • @Pycoder 我理解并同意你的问题。到目前为止,我只见过这种与令牌一起使用的 URL。
    • @Pycoder 好的。我已将您的评论包含在答案中以提高知名度。
    猜你喜欢
    • 2012-10-19
    • 1970-01-01
    • 1970-01-01
    • 2022-08-20
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-08-14
    • 2011-02-21
    相关资源
    最近更新 更多