bjw-s / helm-charts

A collection of Helm charts
https://bjw-s.github.io/helm-charts/
Apache License 2.0
524 stars 98 forks source link

Add support for `resourceFieldRef` in env `valuesFrom` #297

Closed onedr0p closed 3 months ago

onedr0p commented 3 months ago

Details

Describe the solution you'd like:

https://kubernetes.io/docs/tasks/inject-data-application/downward-api-volume-expose-pod-information/#store-container-fields

I would like to be able to do something like this:

        containers:
          app:
            image:
              repository: ghcr.io/onedr0p/qbittorrent-beta
              tag: 4.6.3@sha256:8e6626727f9f14a3a7909850c40c13e50550bd64cbb3177d8806f0225e57654a
            env:
              QBT_Application__MemoryWorkingSetLimit:
                valueFrom:
                  resourceFieldRef:
                    containerName: app
                    resource: limits.memory
                    divisor: 1Mi
...
            resources:
              requests:
                cpu: 100m
              limits:
                memory: 8152Mi
bjw-s commented 3 months ago

Added in version 3.0.4

onedr0p commented 3 months ago

It works, thanks 👍