0

I installed mongodb chart from bitnami as follows

helm install mongodb bitnami/mongodb 

which created this file ./charts/mongodb-10.15.2.tgz

What I do not understand and what I cant find is how to link Secrets to these kind of subcharts. I am aware that values.yaml can override child subcharts. What really confuses me is that this downloaded subchart is just encoded file and I have absolutely no idea how to bend it in terms of deployment/service...

Therefore my question is, how to supply this subchart (of which I dont know anything) with Secrets like dbpassword, dbroot... ? (I hope that the secrets are not supplied via values.yaml override)

Martin
  • 3,333
  • 2
  • 18
  • 39

1 Answers1

3

The links in the context are outdated

When you have sub chart, you map them probably as a dependency (look at the condition carefully, that will match with your values.yaml of the same parent chart.), and here is how you pass the sub-charts values.

Now, I believe you are using this mongodb chart, and in case you want to pass the passwords, you might want to create a k8s secret object and pass the name here.

Now let's say, There is a chart A and MongoDB is a sub chart of the chart A, if you add MongoDB as a dependency like this, you can put the configuration/values of chart MongoDB, in A values, just like this.

Now, for the secrets, there is mentioned in the values.yaml of MongoDB, you can create a custom secret and pass the name of the same there, if still not satisfied, you might want to pass the env vars directly to the MongoDB charts values.

and most importantly, when you defining any chart as dependency or sub chart, you would know which chart it is and what are the values it takes, you can nest the same values in the parent chart.

When you have more time you can spend some here :)

Saikat Chakrabortty
  • 2,520
  • 4
  • 22
  • 39
  • Thanks. You verified me, that my confusion is due to several layers of templating and it all matters how the chart is composed by third party. – Martin May 13 '21 at 13:11
  • Assuming the parent chart A creates a secret named -secret, do you have any idea if it is possible to pass this dynamically generated secret name, to the sub-chart values `existingSecret`, [a git ref here](https://github.com/bitnami/charts/blob/a8d19075c2f92b414548aa2a772f6a5ab21c7f8d/bitnami/mongodb/values.yaml#LL184C21-L184C21). – Neo Anderson May 09 '23 at 14:11