从发布中检索图表工件

问题描述 投票:0回答:1

这是关于helm get syntax for getting the chart of a release的补充问题。

我想了解helm是否支持以下用例:

  1. Alice在她的笔记本电脑上创建了一个图表foo,它存储在笔记本电脑文件系统的目录中: [alice-laptop]$ helm create foo # Alice fiddles with contents of foo, like Chart.yaml, templates...
  2. Alice从她的笔记本电脑中生成foo版本,调用实例bar[alice-laptop]$ helm install -n bar foo
  3. 爱丽丝去度假,在山上徒步旅行。对她有好处!
  4. 当她离开时,鲍勃被要求进行一些更改以释放bar,并开始另一个释放tut安全摆弄。所以Bob希望运行一些命令来检索foo生成时使用的图表bar(不仅仅是名称,而是所有工件!),对它们进行更改并以正确的方式使用helm: [bob-laptop]$ helm whatever-command-if-possible bar # ideally Bob has a `foo' directory now and can fiddle with it... # ... to make the required changes for release `bar' [bob-laptop]$ helm update bar foo # ... and to install another release `tut' [bob-laptop]$ helm install -n tut foo

鲍勃读到get可能是上面的工作whatever-command-if-possible的正确工具,但不知道是否是这种情况,或者是否可以这样做。

kubernetes-helm
1个回答
1
投票

不,以下用例是不可能的。

您只能检索用于从chart Repository创建发布的特定图表

您可能想阅读share your charts with others部分

首先,Alice和Bob应该有一个共同的图表存储库。在这个例子中,他们使用的是公共GCP Bucket通用图表。 charts-example

在去度假之前,在Alice创建并完成在图表上工作之后(以及在创建版本之前),她应该打包图表。

[alice-laptop]$ helm package foo

这将创建foo-0.1.0.tgz图表包。

Successfully packaged chart and saved it to: C:\home\stack\foo-0.1.0.tgz

Alice创建index file并将包和索引文件上传到GCP Bucket

[alice-laptop]$ mkdir common-charts
[alice-laptop]$ mv foo-0.1.0.tgz common-charts
[alice-laptop]$ helm repo index common-charts --url https://common-charts.storage.googleapis.com

[alice-laptop]$ gsutil cp common-charts\* gs://common-charts
Copying file://common-charts\foo-0.1.0.tgz [Content-Type=application/x-tar]...
Copying file://common-charts\index.yaml [Content-Type=application/octet-stream]...
\ [2 files][  1.8 KiB/  1.8 KiB]
Operation completed over 2 objects/1.8 KiB.

当她离开时,Bob可以从公共图表图表库下载foo图表,解压缩并应用更改。

[bob-laptop]$ helm repo add common-charts https://common-charts.storage.googleapis.com
[bob-laptop]$ helm search foo
NAME                    CHART VERSION   APP VERSION     DESCRIPTION
common-charts/foo       0.1.0           1.0             A Helm chart for Kubernetes

[bob-laptop]$ helm fetch common-charts/foo --untar
[bob-laptop]$ ls -la
drwxr-xr-x 1 bob 1049089   0 Dec 20 12:15 foo/

鲍勃也可以add new charts to existing repo和爱丽丝可以在她回来时下载它们。

© www.soinside.com 2019 - 2024. All rights reserved.