-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 GOMEMLIMIT and GOGC #6080
Comments
You should be able to inject env variable using strategic merge patch https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/user-guides/strategic-merge-patch.md |
Something like: apiVersion: monitoring.coreos.com/v1
kind: Prometheus
...
spec:
containers:
- name: "prometheus"
env:
- name: A
value: B |
Thanks. It was not clear from the docs I could do those things. |
This could be a nice addition to https://prometheus-operator.dev/docs/operator/strategic-merge-patch/ |
Or even add it as an option to set it automatically. I now do this magic in helm to set it to 80% of the pod limit:
(caveat: only works if you define memory limit with the unit |
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
Related-to prometheus-operator#6080 Signed-off-by: Jayapriya Pai <slashpai9@gmail.com>
What is missing?
It seems it's not possible to set the
GOMEMLIMIT
andGOGC
environment variables.I could not find it anywhere the docs or the api from the prometheus CRD. So I don't think it's possible. If the CRD would allow to inject arbitrary env variables, it could be solved like this, but I could not find that either.
Why do we need it?
Avoid prometheus instances (especially long-running instances that consume a lot of memory) from getting OOMKilled. See also https://weaviate.io/blog/gomemlimit-a-game-changer-for-high-memory-applications for some information.
The text was updated successfully, but these errors were encountered: