Managing Dependencies
helm dependency update reads Chart.yaml, downloads the listed subcharts into charts/, and writes a lock file.
Syntax
helm dependency update <chart-path>After listing dependencies in Chart.yaml, you must fetch them before installing. That is what the helm dependency commands do.
The commands
helm dependency update— download all listed dependencies intocharts/and writeChart.lock.helm dependency build— rebuildcharts/from an existingChart.lock(reproducible).helm dependency list— show declared dependencies and their status.
Chart.lock
Like a package lock file, Chart.lock pins the exact resolved versions so every build is reproducible. Commit it to version control.
Example
# Add the repos the dependencies come from
helm repo add bitnami https://charts.bitnami.com/bitnami
# Download the subcharts declared in Chart.yaml
helm dependency update ./my-app
# List and verify
helm dependency list ./my-appWhen to use it
- A developer runs helm dependency update after adding a new subchart to Chart.yaml to download the chart archive into the charts/ directory before running helm install.
- A CI pipeline runs helm dependency update as the first step so cached chart archives are refreshed, ensuring the build never uses a stale or missing subchart.
- A chart maintainer checks the generated Chart.lock file into source control after running dependency update so team members can reproduce the exact same subchart versions with helm dependency build.
More examples
Update all dependencies
Refreshes the chart repository index, then downloads all declared dependencies into the charts/ directory.
helm repo update
helm dependency update ./myapp
ls myapp/charts/Build from locked versions
Installs the exact subchart versions pinned in Chart.lock rather than resolving version constraints, ensuring reproducible builds.
# Uses Chart.lock to install exact versions (no network version resolution)
helm dependency build ./myappChart.lock example
Shows the lock file Helm writes after dependency update, pinning exact resolved versions for reproducible builds.
# Chart.lock (auto-generated, commit to source control)
dependencies:
- name: postgresql
repository: https://charts.bitnami.com/bitnami
version: 13.2.0
- name: redis
repository: https://charts.bitnami.com/bitnami
version: 18.1.5
generated: "2024-03-15T10:00:00.000000000Z"
Discussion