langfuse / langfuse-k8s

Community-maintained Kubernetes config and Helm chart for Langfuse
https://langfuse.com
MIT License
44 stars 23 forks source link

Example for using env var secrets is impossible #22

Open AndrewFarley opened 3 days ago

AndrewFarley commented 3 days ago
  additionalEnv:
    - name: DATABASE_URL
      valueFrom:
        secretKeyRef:
          name: my-secrets
          key: langfuse-database-url

This is impossible (via this example) because of how this has been defined.

            {{- range $key, $value := .Values.langfuse.additionalEnv }}
            - name: {{ $key }}
              value: {{ $value | quote }}
            {{- end }}

See: https://github.com/langfuse/langfuse-k8s/blob/main/charts/langfuse/templates/deployment.yaml#L96-L98

I don't want to knock this Helm chart too much because it's saving me time deploying to Kubernetes and I really appreciate that. Through installing this though, it seems many of the common conventions in Helm charts, and doesn't have sane defaults or example configurations. You basically end up having to extract the zip and reverse engineer via the Helm chart's code what the values are expect (eg: inside of an ingress) which to me is not a successful or well-written Helm chart. This chart needs a lot of love to get to a good/better place, if I have lots of free time and if I end up using this extensively, I'll likely invest some time fixing up this chart to get us collectively to a happier/easier place.

AndrewFarley commented 3 days ago

Ahh nevermind I must have an old version of the chart... the latest on main has the fix...

            {{- if .Values.langfuse.additionalEnv }}
              {{- toYaml .Values.langfuse.additionalEnv | nindent 12 }}
            {{- end }}

Well, in that case you may need to re-release/update your Helm chart in the repo so people can get this fix?

AndrewFarley commented 3 days ago

Nevermind even the new code gives a different error with that example, it improperly formats the variables. :(

            - name: 0
              value: "map[name:DATABASE_URL valueFrom:map[secretKeyRef:map[key:database_uri name:langfuse-db]]]"
            - name: 1
              value: "map[name:DATABASE_USERNAME valueFrom:map[secretKeyRef:map[key:username name:langfuse-db]]]"
            - name: 2
              value: "map[name:DATABASE_PASSWORD valueFrom:map[secretKeyRef:map[key:password name:langfuse-db]]]"
            - name: 3
              value: "map[name:LANGFUSE_LOG_LEVEL value:info]"
            - name: 4
              value: "map[name:LANGFUSE_LOG_FORMAT value:json]"