helm: set a value for a dependency

kubernetes helm chart dependency

2 min read | by Jordi Prats

If you are writing a helm chart, it makes no sense to add all the yaml files on your helm chart when there's already a helm chart for some of the components: It's always best to reuse existing code so including another chart as dependency will deploy all the related yaml files.

dependencies:
  - name: minio
    version: 8.0.8
    repository: https://helm.min.io/

Nevertheless, how do we change a default value for the chart we add as dependency?

On the base chart's values we just need to create a key for the dependency with the values we want to set. For example:

minio:
  persistence:
    size: 20Gi

This is going to automatically inject this value as an input to this dependency. This way we can set the most appropriate default values given the application we are deploying using our own helm chart.

If a given value is not set this way, it will use the default value set on the sub-chart itself


Posted on 12/01/2021

Categories