quickwit-oss / helm-charts

Helm charts for Quickwit
https://helm.quickwit.io
MIT License
22 stars 28 forks source link

Support full spec of env specification #102

Open xrl opened 1 month ago

xrl commented 1 month ago

Right now the .Values.metastore.extraEnv is expected as only literal K/V pairs and does not allow for the pulling in an environment variable from a secret. For me it is important to have the power to remap keys from a secret, I can't just use envFrom because the keys don't match what is expected by quickwit.

I don't think the helm chart should take such a strong opinion on the environment variables, allow the user to write YAML which gets substituted in. Something like:

possible values spec:

        metastore:
          extraEnv:
           -  name: QW_METASTORE_URI
              valueFrom:
                secretRef:
                  name: quickwittracing-postgres-direct-secret
                  key: POSTGRES_URL
          - name: SOMETHING_ELSE
            value: "asdf"

and then in the metastore-deployment.yaml:

# SNIP
spec:
   # snip
  template:
    # snip
    spec:
      # snip
      containers:
        - name: {{ .Chart.Name }}
          # snip
          env:
            {{- include "quickwit.environment" . | nindent 12 }}
            {{- .Values.metastore.extraEnv | nindent 12}}

and now the helm chart can support mapping/remapping ENV vars from literal, configmaps, and secrets. This would be a breaking change -- perhaps we want to add a new config variable while continuing to support the K/V style?

guilload commented 1 week ago

Hi @xrl,

What about using extraEnvFrom for secrets?