Search code examples
mongodbdockerkubernetes-helm

Helm overriding child chart values from parent chart


I am new to Helm and using Helm 3. I am trying to build a simple helm chart which depends on the mongodb helm chart available from bitnami here.

This is the structure of my chart:

mychart
|- charts\
   |- mongodb-8.1.1.tgz
|- Chart.yaml
|- values.yaml

I am trying to override the value of mongodb.rootPassword (and some other properties) through the values.yaml file of the parent chart. However, it does not override the value specified and reverts to the default values from the mongodb chart.

It would be a great help to understand what I am doing wrong and how can I override the value of the child chart from the parent chart.

Here are the contents of my files:

Chart.yaml

apiVersion: v2
name: mychart
appVersion: "1.0"
description: mychart has the best description
version: 0.1.0
type: application
dependencies:
  - name: mongodb
    version: 8.1.1
    repository: https://charts.bitnami.com/bitnami
    condition: mongodb.enabled

values.yaml

mongodb:
    global:
        namespaceOverride: production
    fullnameOverride: mongo-mychart
    useStatefulSet: true
    auth:
        rootPassword: example
    persistence:
        size: 100Mi

Solution

  • This is possible in case the format of the values.yaml file has an issue. In this case, the values.yaml file of the parent chart had a few extra encoded characters which were causing it to be ignored by helm and defaulting the child chart's values.