solr-operator icon indicating copy to clipboard operation
solr-operator copied to clipboard

Adding support to dynamic value in values.yaml

Open idolaman opened this issue 2 years ago • 2 comments

First of all this project is amazing!

I encountered an issue when i tried to use this chart as an dependency to my chart.

in my use case i want to be able to give a dynamic value in values yaml. for an example i want that the configmap name to be dynamic because i want to deploy multiple solr cluters in the same k8s envirement. my chart values.yaml

global:
  configmap: idolaman

solr:
  podOptions:
    volumes:
      - name: my-configmap
        source:
          configMap:
            name: "{{ .Values.global.configmap }}"
         
...

my Chart.yaml

name: idolaman-solr
dependencies:
  - name: solr
    ....

an solution might be change the solr chart to evaluate using tpl every value it gets

idolaman avatar Nov 28 '23 11:11 idolaman

Is this common for other Helm charts?

I understand how it could be useful, but it would add a lot of complexity to the already fairly complex helm chart.

HoustonPutman avatar Nov 28 '23 16:11 HoustonPutman

@HoustonPutman I also think that it would be nice and actually I think it's quite common. I've found this article that helps with this issue. In this example, the tpl function is used in the Helm chart templates to allow for dynamic referencing of values. Useful for scenarios where you want to deploy multiple instances of an application (like multiple Solr clusters).

This example aligns with this scenario where we want to dynamically set the configmap name for deploying multiple Solr clusters.

To show the need for the feature in general I'm referring you to a SO question the requests the same.

almogtavor avatar Nov 29 '23 20:11 almogtavor