Interview Prep/Helm/Dependencies, Subcharts & Library Charts

How do you declare a chart dependency in Helm 3?

BeginnerConceptDependencies, Subcharts & Library Charts
Answer

In the dependencies list of Chart.yaml (Helm 2 used a separate requirements.yaml):

dependencies:
  - name: postgresql
    version: "16.x.x"
    repository: "oci://registry-1.docker.io/bitnamicharts"
    condition: postgresql.enabled
  - name: shop-postgres
    version: "0.1.0"
    repository: "file://../shop-postgres"
    alias: postgres

repository can be an HTTP repo URL, an @alias of a repo you added locally, an oci:// reference or a file:// path.

All Helm questions Roadmap: Helm

More on Dependencies, Subcharts & Library Charts