作为 Cloud Native Computing Foundation(CNCF)的研究项目,Helm 已成为 Kubernetes 的事实软件包管理器,因为它简化了应用被打包和部署的方式。Helm 使用名为 Charts 的打包格式,其中包含代表应用程序的 Kubernetes 资源。可以为存储库中的常规分发和使用提供 chart。Helm 仓库是提供 index.yaml 元数据文件的 HTTP 服务器,以及一组可选的打包 chart。从 Helm 版本 3 开始,支持以替代传统仓库的方式在 OCI registry 中分发 chart。要演示如何将 Quay 用作 Helm chart 的 registry,会使用 Helm 仓库中的现有 chart 来展示与 OCI registry for Chart 开发者和用户的交互。
在以下示例中,从红帽实践(CoP)软件仓库中下载了一个 etherpad chart 示例,并使用以下步骤将其推送到本地 Red Hat Quay 存储库:
helm repo add redhat-cop https://redhat-cop.github.io/helm-charts
helm repo update
helm pull redhat-cop/etherpad --version=0.0.4 --untar
$ helm repo add redhat-cop https://redhat-cop.github.io/helm-charts
$ helm repo update
$ helm pull redhat-cop/etherpad --version=0.0.4 --untar
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm chart save ./etherpad example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
$ helm chart save ./etherpad example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
ref: example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
digest: 6850d9b21dd4b87cf20ad49f2e2c7def9655c52ea573e1ddb9d1464eeb6a46a6
size: 3.5 KiB
name: etherpad
version: 0.0.4
0.0.4: saved
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm chart list
REF NAME VERSION DIGEST SIZE CREATED
example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4 etherpad 0.0.4 ce0233f 3.5 KiB 23 seconds
helm chart list
REF NAME VERSION DIGEST SIZE CREATED
example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4 etherpad 0.0.4 ce0233f 3.5 KiB 23 seconds
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm registry login example-registry-quay-quay-enterprise.apps.user1.example.com
$ helm registry login example-registry-quay-quay-enterprise.apps.user1.example.com
Username: quayadmin
Password:
Login succeeded
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm chart push example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
$ helm chart push example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
The push refers to repository [example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad]
ref: example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
digest: ce0233fd014992b8e27cc648cdabbebd4dd6850aca8fb8e50f7eef6f2f49833d
size: 3.5 KiB
name: etherpad
version: 0.0.4
0.0.4: pushed to remote (1 layer, 3.5 KiB total)
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm chart rm example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
rm -rf etherpad
helm chart pull example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
$ helm chart rm example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
$ rm -rf etherpad
$ helm chart pull example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
0.0.4: Pulling from example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad
ref: example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
digest: 6850d9b21dd4b87cf20ad49f2e2c7def9655c52ea573e1ddb9d1464eeb6a46a6
size: 3.5 KiB
name: etherpad
version: 0.0.4
Status: Downloaded newer chart for example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
helm chart export example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
$ helm chart export example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
ref: example-registry-quay-quay-enterprise.apps.user1.example.com/helm/etherpad:0.0.4
digest: ce0233fd014992b8e27cc648cdabbebd4dd6850aca8fb8e50f7eef6f2f49833d
size: 3.5 KiB
name: etherpad
version: 0.0.4
Exported chart to etherpad/
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow