thanos-io / kube-thanos

Kubernetes specific configuration for deploying Thanos.
Apache License 2.0
522 stars 176 forks source link

add extraEnv to all containers to make injection of custom env vars easier #246

Closed mwasilew2 closed 3 years ago

mwasilew2 commented 3 years ago

I need to inject some environment variables to all Thanos pods (to configure tracing). Considering this is currently not supported by the lib I'll be probably doing this by patching multiple components in the generated json.

Would adding support for it be something you'd be interested in? I'm happy to prepare a PR

For example, for kube-thanos-store it could be something like:

(...)
      env: [
        (existing env config)
      ] + (
        if std.length(ts.config.extraEnv) > 0 then [
         ts.config.extraEnv,
        ] else []
      ),

(...)

not sure who the maintainers are, pinging @yeya24 @brancz @metalmatze for some feedback

mwasilew2 commented 3 years ago

Just realized that tracing in Thanos is configured via cli flags, not via env vars (e.g. https://github.com/jaegertracing/jaeger-client-go#environment-variables ) . I won't need this to move on with my config change, but if others find it useful I can still create a PR. Otherwise the issue can be closed.

yeya24 commented 3 years ago

SGTM @mwasilew2!