Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

168
Views
Use Chart Values from Subchart in Helm

using 0.13.2 Helm provider terraform, I have a Chart with a subchart nested:

├── charts
│   └── postgres
│       ├── Chart.yaml
│       ├── templates
│       │   ├── deployment.yaml
│       │   ├── env.yaml
│       │   └── service.yaml
│       └── values.yaml
├── Chart.yaml
├── templates
│   ├── configmap.yaml
│   ├── deployment.yaml
│   ├── env.yaml
│   ├── ingress.yaml
│   └── service.yaml
└── values.yaml

I need to use from the deployment.yml of the postgres subchart, the values of the parent chart. How can I config the configmap of the subchart to get the parent chart values? My current configmap is like this:

apiVersion: v1
kind: ConfigMap
metadata:
  name: {{ .Release.Name }}-postgres-env
  namespace: {{ .Release.Namespace }}
data:
  {{- range $key, $val := .Values.environment }}
  {{ $key }}: {{ $val | quote }}
  {{- end }}

Thanks in advance.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

You can't directly do this. In discussing Scope, Dependencies, and Values, the Helm documentation notes (with a motivating example):

Charts at a higher level have access to all of the variables defined beneath. So the WordPress chart can access [.Values.child.setting]. But lower level charts cannot access things in parent charts, so [the child] will not be able to access [a parent] property. Nor, for that matter, can it access [sibling subchart settings].

You have two options. If you move the settings under a global: key

global:
  environment:
    keys: values

then the parent and all subcharts will be able to access .Values.global.environment. Or, if you move the settings under a key specific to the subchart

postgres:
  environment:
    keys: values

then the subchart will see .Values.environment, and the parent can reference .Values.postgres.environment.

(If you can't use a prepackaged PostgreSQL chart, it's not necessarily wrong to flatten these parts into a single chart, making it clear from the filenames that something is statefulset-postgres.yml or svc-postgres.yml. Then the templates would be able to use the single .Values.)

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!