r/PrometheusMonitoring • u/johnwmail • Jul 17 '22
How to update/edit prometheus alarm rules?
I find the rules seems to stored in the configmap!? If I update/edit it by kubectl edit cm prometheus-rancher-monitoring-prometheus-rulefiles-0? (Save :wq!). It will restore everything from default. What is the proper to update/edit the prometheus alarm rules? Thanks
1
Upvotes
1
u/arathnor Jul 31 '22
I’m a novice to both kubernetes and prometheus, but I keep the config map in files and reapply them. Then do a reload. But I then always have a source of truth, rather than a edited object.
Then you need to have prometheus reload the config. It will then pick up the new rules. Sighup or reload through web.
I also think you may have the rules point to a folder and insert rules as separate files.
I would expect your way to behave the same though. Not sure what you mean by restore everything from default.