-
Notifications
You must be signed in to change notification settings - Fork 364
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
Add PodMonitors to configure Prometheus how to monitor Redis and Sentinel pods #624
base: master
Are you sure you want to change the base?
Conversation
Really wonderful! Do you need any help to finish it? |
Thanks for the offer. I've tested it on production and it works well. Still, if you have the time, I'd appreciate it if you could review and test it. All comments are welcome. Also, I've implemented this to resolve the issues mentioned in the PR. If you have similar use cases, please share it in #623 . So we can discuss them and hopefully extend this PR. |
Hi! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! Just a couple of comments
@@ -13,10 +13,26 @@ func (w *RedisFailoverHandler) Ensure(rf *redisfailoverv1.RedisFailover, labels | |||
if err := w.rfService.EnsureRedisService(rf, labels, or); err != nil { | |||
return err | |||
} | |||
if err := w.rfService.EnsureRedisPodMonitor(rf, labels, or); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail for deployments that have enabled the exporter but not podmonitor CRD. I think we should only ensure pod monitor when it has been defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. I will fix it.
} | ||
|
||
if rf.Spec.Sentinel.Exporter.Enabled { | ||
if err := w.rfService.EnsureSentinelPodMonitor(rf, labels, or); err != nil { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail for deployments that have enabled the exporter but not podmonitor CRD. I think we should only ensure pod monitor when it has been defined
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Will fix it.
@hashemi-soroush were you able to fix those lastly mentioned problems? |
Hey @lord-kyron, |
Fixes #383 , #494 and #623 .
Changes proposed on the PR:
PodMonitor
config field toExporter
in theRedisFailover
CRDPodMonitor
CRs according toRedisFailover
CRPodMonitor
CRsPodMonitor
Kubernetes client