A subchart needs a password that the parent generates. How do you share it?
AdvancedScenarioDependencies, Subcharts & Library Charts
Answer
Situation read → Subcharts cannot see parent values, and generating it twice gives two different values.
What I'd do →
- Prefer an "existing secret" pattern: the parent (or an ExternalSecret) creates a Secret with a known name, and the subchart is configured with
auth.existingSecret: shop-db. - Or pass the same value explicitly to both: parent
db.passwordandpostgres.auth.passwordfrom one secrets file. - Avoid
randAlphaNumin both places.
Why → One Secret object, referenced by name, avoids duplication and drift.
Interview tip → "existingSecret" is the pattern most good charts support; mention it.
More on Dependencies, Subcharts & Library Charts
How do you declare a chart dependency in Helm 3?BeginnerWhat is the difference between `helm dependency update` and `helm dependency build`?IntermediateWhat is `Chart.lock` and why commit it?BeginnerHow does `condition` work on a dependency?BeginnerWhat are `tags` on dependencies?IntermediateWhat does `alias` do on a dependency?Intermediate