How do chart dependencies (sub-charts) work?
⚡
Quick Answer
Declare them in Chart.yaml with a repository and version; helm dependency update vendors them, and conditions toggle them.
Detailed Answer
dependencies: lets a chart pull in others (e.g. postgresql). helm dependency update fetches them into charts/. A condition (postgresql.enabled) lets consumers disable a dependency to bring their own. Pin dependency versions for reproducibility.
Code Example
dependencies:
- name: postgresql
version: "15.x.x"
repository: https://charts.bitnami.com/bitnami
condition: postgresql.enabled💡
Interview Tip
Mention condition: for optional dependencies.
helmdependenciessubcharts