I'm trying to create a chart with multiple subcharts ( 2 instances of ibm-db2oltp-dev). Is there a way to define in the same values.yaml file, different configuration for each instance?
I need two databases:
db2inst.instname: user1
db2inst.password: password1
options.databaseName: dbname1
db2inst.instname: user2
db2inst.password: password2
options.databaseName: dbname2
I saw it could be done via alias but I didn't find an example explaining how to do it. Is it possible?
Yes, it's possible to have multiple values files with Helm. Just use the --values flag (or -f ). You can also pass in a single value using --set . --set (and its variants --set-string and --set-file): Specify overrides on the command line.
You can use a --set flag in your Helm commands to override the value of a setting in the YAML file. Specify the name of the setting and its new value after the --set flag in the Helm command. The --set flag in the above command overrides the value for the <service>. deployment.
A subchart is considered "stand-alone", which means a subchart can never explicitly depend on its parent chart. For that reason, a subchart cannot access the values of its parent. A parent chart can override values for subcharts. Helm has a concept of global values that can be accessed by all charts.
Yes, it is possible:
In Chart.yaml for Helm 3 or in requirements.yaml for Helm 2:
dependencies:
- name: ibm-db2oltp-dev *(full chart name here)*
repository: http://localhost:10191 *(Actual repository url here)*
version: 0.1.0 *(Required version)*
alias: db1inst *(The name of the chart locally)*
- name: ibm-db2oltp-dev
repository: http://localhost:10191
version: 0.1.0
alias: db2inst
parentChart/values.yaml:
someParentChartValueX: x
someParentChartValueY: y
db1inst:
instname: user1
db2inst: password1
db2inst:
instname: user2
db2inst: password2
Actually it cannot be achieved in Helm (by aliases too) because values resolving doesn't work for aliased charts. The only way is to define values for chart name:
<chart_name not alias>:
var1: value
var2: value
The source issue: https://github.com/helm/helm/issues/7093
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With