【问题标题】:Migrate helm chart from public repository to private将 helm chart 从公共存储库迁移到私有存储库
【发布时间】:2020-12-10 21:01:09
【问题描述】:

我正在尝试在 AWS EKS 上使用 helm chart 部署一些服务。

$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install postgresql --version 8.6.4 bitnami/postgresql

运行 helm 命令后,没有创建 pod,因为与 docker.io 的连接在 EKS 中被阻止。

$ kubectl describe po 
...
Events:
  Type     Reason                  Age                  From                     Message
  ----     ------                  ----                 ----                     -------
  Normal   Scheduled               12m                  default-scheduler        Successfully assigned airflow/postgresql-postgresql-0 to xxxxxx.compute.internal
  Normal   SuccessfulAttachVolume  12m                  attachdetach-controller  AttachVolume.Attach succeeded for volume "pvc-e3e438ef-50a4-4c19-a788-3d3755b89bae"
  Normal   Pulling                 9m50s (x4 over 12m)  kubelet                  Pulling image "docker.io/bitnami/postgresql:11.7.0-debian-10-r26"
  Warning  Failed                  9m35s (x4 over 11m)  kubelet                  Failed to pull image "docker.io/bitnami/postgresql:11.7.0-debian-10-r26": rpc error: code = Unknown desc = Error response from daemon: Get https://registry-1.docker.io/v2/: net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)
  Warning  Failed                  9m35s (x4 over 11m)  kubelet                  Error: ErrImagePull
  Warning  Failed                  9m23s (x6 over 11m)  kubelet                  Error: ImagePullBackOff
  Normal   BackOff                 113s (x36 over 11m)  kubelet                  Back-off pulling image "docker.io/bitnami/postgresql:11.7.0-debian-10-r26"

如何将存储库域从 docker.io 更改为我的 ECR 存储库?

  1. 我想将此图表推送到我的 ECR 存储库。
  2. 我想制作图表以不是从 docker.io 而是从我的 ECR 存储库中提取图像。

【问题讨论】:

    标签: kubernetes kubernetes-helm amazon-ecr


    【解决方案1】:

    尝试使用--set 覆盖bitnami/postgresql 的values.yaml 中的存储库域值怎么样。详情请参考here

    image:
      registry: docker.io
      repository: bitnami/postgresql
      tag: 11.10.0-debian-10-r24
    

    您可以按如下方式覆盖上面的 image.registry 值。

    $ helm install postgresql \
      --set image=your-registry/bitnami/postgresql:11.10.0-debian-10-r24 \
      --version 8.6.4 bitnami/postgresql
    

    【讨论】:

      猜你喜欢
      • 2022-12-19
      • 2019-08-30
      • 2016-10-18
      • 2017-08-18
      • 2012-09-16
      • 2013-09-13
      • 1970-01-01
      • 2019-11-08
      • 1970-01-01
      相关资源
      最近更新 更多