How do I create an arbitrary number of instances of the same dependency chart in Helm 3?

3/20/2020

My application requires us to be running multiple instances of a database, let's say InfluxDB. The chart we are writing should allow us to run an arbitrary number of databases, based on the values passed to the chart, so I can't alias a fixed number of times the influxdb chart in the Chart.yaml file.

The way I want to solve this challenge, is by having my main chart main have a range of values that specify the configuration. A quick example of values.yaml

databases:
 - type: influxdb
   name: influx1
   port: 9001
 - type: influxdb
   name: influx2
   port: 9002

I can iterate over this array with range easily, but I'm unsure of how to "call" the dependency chart from the main.yaml file. Arborescence:

main_chart
├── charts
│   └── influxdb-1.2.3.tgz
├── Chart.yaml
├── templates
│   └── main.yaml
└── values.yaml

I tried using {{- include "influxdb" .Values.some_test_config}}, but I get a No template influxdb associated with template gotpl error.

I also went through the Helm docs, but didn't find an answer.

Thanks for following through ! Any thoughts ?

-- lelithium
kubernetes-helm

0 Answers