【问题标题】:Helm always reports a 403 error when adding minio repoHelm 在添加 minio repo 时总是报 403 错误
【发布时间】:2020-06-17 04:39:59
【问题描述】:

我已经用Docker运行了最新版本的minio,可以通过浏览器正常访问。 然后我安装了 MC 客户端并用 MC 测试了 Minio,一切正常。 但是当我使用 helm 添加 minio repo 时。我收到 403 错误。

[root@k8smaster01 helm-charts]# mc config host list
gcs    
  URL       : https://storage.googleapis.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v2
  Lookup    : dns

local  
  URL       : http://localhost:9000
  AccessKey : 
  SecretKey : 
  API       : 
  Lookup    : auto

myminio
  URL       : http://172.16.5.182:9000
  AccessKey : minioadmin
  SecretKey : minioadmin
  API       : s3v4
  Lookup    : auto

play   
  URL       : https://play.min.io
  AccessKey : Q3AM3UQ867SPQQA43P2F
  SecretKey : zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG
  API       : S3v4
  Lookup    : auto

s3     
  URL       : https://s3.amazonaws.com
  AccessKey : YOUR-ACCESS-KEY-HERE
  SecretKey : YOUR-SECRET-KEY-HERE
  API       : S3v4
  Lookup    : dns

[root@k8smaster01 helm-charts]# mc ls myminio
[2020-06-16 18:10:01 CST]      0B minio-helm-repo/
[root@k8smaster01 helm-charts]# mc ls myminio/minio-helm-repo/
\[2020-06-16 18:17:20 CST]     76B index.yaml
[root@k8smaster01 helm-charts]# helm repo add minio-test-repo http://172.16.5.182:9000/minio-helm-repo
Error: looks like "http://172.16.5.182:9000/minio-helm-repo" is not a valid chart repository or cannot be reached: failed to fetch http://172.16.5.182:9000/minio-helm-repo/index.yaml : 403 Forbidden
[root@k8smaster01 helm-charts]#
[root@k8smaster01 helm-charts]# helm repo add minio-test-repo http://172.16.5.182:9000/minio-helm-repo --username minioadmin --password minioadmin
Error: looks like "http://172.16.5.182:9000/minio-helm-repo" is not a valid chart repository or cannot be reached: failed to fetch http://172.16.5.182:9000/minio-helm-repo/index.yaml : 400 Bad Request
[root@k8smaster01 helm-charts]#

我的minio版本是最新的(RELEASE.2020-06-14T18-32-17Z) 我的 mc 版本是 RELEASE.2020-05-28T23-43-36Z 我的掌舵版本是 version.BuildInfoVersion:"v3.2.3"

如何成功地将 repo 添加到 helm?

【问题讨论】:

    标签: kubernetes-helm minio helm-tls


    【解决方案1】:

    你写道:

    API:s3v4

    据我所知,helm 不能原生使用 s3,所以在我们的场景中,我们使用了 helm s3 插件,它提供了 s3 协议支持。

    GitHub 仓库:https://github.com/hypnoglow/helm-s3

    根据您的情况,您可能还需要设置一些环境变量,请参阅https://github.com/hypnoglow/helm-s3/blob/master/hack/integration-tests-local.sh#L9 了解更多详细信息 (提示:S3-Endpoint URL 是通过 AWS_ENDPOINT ENV 变量设置的,因此请确保已设置)

    安装和配置插件后,我能够初始化并添加 repo。

    一定要初始化你的 repo (请注意,端点 URL 不是 s3-url 的一部分。s3 插件使用 AWS_ENDPOINT ENV 变量来设置端点 URL。“test-bucket/charts”是定义的 repo 上存储桶的位置):

    helm s3 init s3://test-bucket/charts
    

    这是设置 repo 并添加 index.yaml

    然后你可以添加回购

    helm repo add repo-name s3://test-bucket/charts
    

    添加repo后可以推送图表

    helm s3 push chart.tgz repo-name
    

    还请查看以下脚本,它帮助我了解正确添加、初始化和使用 repo 所需的步骤: https://github.com/hypnoglow/helm-s3/blob/master/hack/integration-tests.sh

    此外,索引是由插件在推送时自动完成的 (见https://github.com/hypnoglow/helm-s3#push

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-03-07
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-02-16
      • 2021-08-03
      • 2021-04-08
      相关资源
      最近更新 更多