Prod uses RDS while dev uses an in-cluster Postgres subchart. How do you configure the chart?
IntermediateScenarioValues & Environments
Answer
Situation read → Same app, different database source.
What I'd do →
- Dependency with
condition: postgres.enabled; dev setstrue, prodfalse. - Add
externalDatabase.host,port,existingSecretvalues for prod. - A helper
shop.dbHostreturns the subchart Service name or the external host, and fails if neither is configured. - Prod credentials come from an ExternalSecret referencing Secrets Manager.
Why → One chart, explicit switch, with a helper hiding the difference from templates.
Interview tip → Show the fail guard for the "nothing configured" case.
More on Values & Environments
Dev, staging and prod values files have drifted and nobody knows which settings differ intentionally. What do you do?IntermediateA deploy pipeline uses `--reuse-values` and a new chart version just broke production. Why, and what do you change?AdvancedYou need a per-environment image tag set by CI, while everything else lives in Git. How do you wire it?BeginnerA value that should be `false` in prod keeps rendering as enabled. Where do you look?IntermediateDifferent clusters need different storage classes and ingress classes. How do you keep the chart portable?IntermediateA developer passes 20 `--set` flags in a shell script. What would you change?Beginner