Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting env vars for config-reloader created for Prometheus Kind #6560

Open
xbglowx opened this issue May 2, 2024 · 5 comments
Open

Comments

@xbglowx
Copy link

xbglowx commented May 2, 2024

Component(s)

Prometheus

What is missing? Please describe.

The ability to pass env vars to the config-reloader that is created by the operator that is for Prometheus Kind.

I originally created an issue under the helm chart, but I think a better place for it would be here instead? prometheus-community/helm-charts#3982

Describe alternatives you've considered.

I was able to use Kustomize to patch the config-reloader container that is part of the Operator Pod, since that is a resource that gets created directly from the helm chart, but can't do the same for the config-reloader that gets created by Prometheus kind.

Environment Information.

Environment

Kubernetes Version: 1.27.12
Prometheus-Operator Version: v0.71.2

@xbglowx xbglowx added kind/feature needs-triage Issues that haven't been triaged yet labels May 2, 2024
@xbglowx xbglowx changed the title Allow setting env vars config-reloader created for Prometheus Kind Allow setting env vars for config-reloader created for Prometheus Kind May 2, 2024
@simonpasquier
Copy link
Contributor

it should be possible using strategic merge patch: https://prometheus-operator.dev/docs/operator/strategic-merge-patch/#how-to-inject-an-environment-variable-in-an-existing-container

@simonpasquier simonpasquier added kind/support and removed kind/feature needs-triage Issues that haven't been triaged yet labels May 6, 2024
@simonpasquier
Copy link
Contributor

But if the request is "I want the containers to pick up the correct GOMAXPROCS based on the CPU resource limits", I'd be open to integrate with https://github.com/uber-go/automaxprocs.

@xbglowx
Copy link
Author

xbglowx commented May 7, 2024

it should be possible using strategic merge patch: https://prometheus-operator.dev/docs/operator/strategic-merge-patch/#how-to-inject-an-environment-variable-in-an-existing-container

Thanks and sorry that I totally missed that option.

@xbglowx
Copy link
Author

xbglowx commented May 7, 2024

But if the request is "I want the containers to pick up the correct GOMAXPROCS based on the CPU resource limits", I'd be open to integrate with https://github.com/uber-go/automaxprocs.

Yes, this would be a nice to have, so that one doesn't have to worry about setting GOMAXPROCS in the first place.

@simonpasquier
Copy link
Contributor

simonpasquier commented May 21, 2024

Closed by #6576

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants