Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

174
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda