-
Notifications
You must be signed in to change notification settings - Fork 158
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
Prometheus rule created but not loaded on prometheus operator #125
Comments
Hi @stafot Once the Prometheus operator Rules CRs are created, Sloth's job finishes, and you shouldn't need to do anything manually either. Are you already loading automatically any other rules (apart from the Sloth ones) with the Prometheus operator? Normally when you create a Prometheus instance with the Prom-operator, you will tell what is the label selector this Prometheus needs to match to discover the rules it should own (and load), if you don't have this configured correctly it will not discover the created rules. For example: apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
name: prometheus
namespace: monitoring
labels:
prometheus: prometheus
spec:
# ...
ruleSelector:
matchLabels:
prometheus: prometheus
role: my-awesome-rules
# ... Now my PrometheusRules CRs at least should have ---
apiVersion: sloth.slok.dev/v1
kind: PrometheusServiceLevel
metadata:
name: some-slo
namespace: monitoring
labels:
prometheus: prometheus
role: my-awesome-rules
app: sloth
something: something
spec:
# ... Let me know if this solves the problem. |
Thanks for your quick answer. I will review my setup based on your instructions and I will come back to you! Appreciated. |
@slok Thank you very much, your suggestion did the trick. |
Awesome! |
Hello,
I am not sure if this is a bug or I am missing something in setup process.
I am trying to setup sloth on my cluster based on this approach https://github.com/slok/sloth#kubernetes-controller-prometheus-operator.
I successfully set up the sloth controller which runs without any errors.
I added a sample slo for a service running. The respective prometheus rule created successfully. But the rule doesn't get attached to prometheus operator. Should I do it manually? If yes why not to follow the cli approach instead?
Thanks in advance for any answer.
The text was updated successfully, but these errors were encountered: