You need to inject a JSON config blob as a single value. What is the cleanest way?
IntermediateScenarioValues & Environments
Answer
Situation read → JSON inside YAML strings is error prone with quoting.
What I'd do →
- Model it as structured YAML in values and render it with
toJson(ortoPrettyJson) into the ConfigMap:
data:
config.json: {{ .Values.app.config | toJson | quote }}
- For one-off structured overrides on the CLI, use
--set-json 'app.config={"retries":3}'. - Validate the structure in
values.schema.json.
Why → Structured values merge across files; opaque strings do not.
Interview tip → Mention that structured values allow per-environment partial overrides.
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