Retrieve chart artifacts from a release

12/16/2018

This is a complementary question with respect to helm get syntax for getting the chart of a release.

I'd like to understand whether the following use case is supported with helm or not:

  1. Alice creates a chart foo on her laptop, which is stored in a directory in the laptop's filesystem:

    [alice-laptop]$ helm create foo
    # Alice fiddles with contents of foo, like Chart.yaml, templates...
  2. Alice generates a release of foo from her laptop, calling the instance bar:

    [alice-laptop]$ helm install -n bar foo
  3. Alice goes in a vacation, hiking on the mountains. Good for her!

  4. While she is away, Bob is asked to make some changes to release bar and also start another release tut for safe fiddling. So Bob would like to run some command to retrieve chart foo (not just the name, but all artifacts!) that were used at the time of generation of bar, to make changes on them and use helm the right way:

    [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 

Bob reads that get might be the right tool for the job whatever-command-if-possible above, but doesn't really know whether this is the case or not, or if this can be done at all.

-- polettix
kubernetes-helm

1 Answer

12/17/2018

No, the following use case is not possible.

You can only retrieve a specific chart that was used to create a release from chart Repository

You may want to read share your charts with others section

First of all, Alice and Bob should have a common chart repository. In this example they're using a public GCP Bucket common-charts. charts-example

Before going on vacation, after Alice creates and finishes to work on chart (and before creating a release from it), she should package the chart.

[alice-laptop]$ helm package foo

This will create foo-0.1.0.tgz chart package.

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

Alice creates index file and uploads package and index file to 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.

While she is away, Bob can download foo chart from common-charts chart repository, untar it and apply changes.

[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/

Bob can also add new charts to existing repo and Alice can download them when she is back.

-- edbighead
Source: StackOverflow