Interview Prep/Helm/Dependencies, Subcharts & Library Charts

How does `condition` work on a dependency?

BeginnerConceptDependencies, Subcharts & Library Charts
Answer

condition is a values path (or comma-separated list of paths, first one found wins) that enables or disables the subchart:

dependencies:
  - name: shop-postgres
    condition: postgres.enabled
helm upgrade shop ./shop --set postgres.enabled=false --set externalDatabase.host=shop.xxxx.rds.amazonaws.com

When disabled, none of the subchart's templates render. This is the standard way to use an in-cluster database in dev and RDS in prod with the same chart.

All Helm questions Roadmap: Helm

More on Dependencies, Subcharts & Library Charts