abinet
abinet

Reputation: 2788

helm chart with dependency: how to package properly

I have a parent helm chart with some child chart defined as a dependency in requirements.yaml. Child chart is packaged and uploaded to some-repo.

Currently I'm doing:

And when I'm trying to install via helm install some-repo/parent-chart I get only parent chart installed but not the child chart.

How do I need to package parent chart to be able to install it with the child chart together?

Upvotes: 7

Views: 8737

Answers (4)

Martin H.
Martin H.

Reputation: 574

As @jeremysprofile has already pointed out, with Helm 3 you can do the following:

# Navigate to the root of my parent chart
cd path/where/my/chartyml/is

# package my chart (-u being the shorthand for --dependency-update)
helm package -u .

This should:

  1. if it is not already existing, create a chart/ folder within your project root which contains all the child charts (as .tgz) defined as dependencies within the chart.yml of the parent chart.
  2. create a my-chart-name-as-defined-in-chartyml.tgz in the root of the parent chart, which contains pretty much everything in that parent chart directory, except the things defined in your .helmignore file.

Upvotes: 4

rokpoto.com
rokpoto.com

Reputation: 10718

Follow full helm chart dependencies SDLC flow in order to avoid failures in CI/CD pipelines.

Upvotes: 0

jeremysprofile
jeremysprofile

Reputation: 11425

You can now do this via

helm package --dependency-update parent-chart

and save yourself the separate line suggested by the other answer.

Upvotes: 5

abinet
abinet

Reputation: 2788

One additional step should be added:

helm dep update parent-chart

it places child-chart.tgz into chart folder of parent chart and then packaging works

Upvotes: 12

Related Questions