spotahome / redis-operator

Redis Operator creates/configures/manages high availability redis with sentinel automatic failover atop Kubernetes.
Apache License 2.0
1.52k stars 363 forks source link

Add support for creating PodMonitor or ServiceMonitor #494

Closed sagikazarmark closed 1 year ago

sagikazarmark commented 2 years ago

Resubmitting #383 since it was accidentally closed.

Expected behaviour

Create PodMonitor/ServiceMonitor object for Redis and Sentinel.

Actual behaviour

Prometheus exporters are integrated into the RedisFailover CRD, but they still require PodMonitors or ServiceMonitors.

Proposed solution

Allow creating PodMonitor or ServiceMonitor resources along with exporters. For example:

apiVersion: databases.spotahome.com/v1
kind: RedisFailover
metadata:
  name: redis
spec:
  redis:
    exporter:
      enabled: true
    monitoring:
      podMonitor:
          enabled: true
  sentinel:
    exporter:
      enabled: true
    monitoring:
      podMonitor:
          enabled: true

Additional details

I'd be happy to draft a PR if you like the idea.

Wouter0100 commented 2 years ago

We deployed the legacy Prometheus annotations to provide a workaround to this. Would however rather move to this.

sagikazarmark commented 2 years ago

You can always create your own ServiceMonitor, can't you? I mean you don't have to use Prometheus annotations even without builtin support for ServiceMonitors.

Wouter0100 commented 2 years ago

Correct, but the Prometheus annotations were easier to add in our current setup :-).

sagikazarmark commented 2 years ago

Can't argue with that. 😄

Wouter0100 commented 2 years ago

Interestingly enough, I found out they're added to the rfr service already. They are however not present on the rfs service.

colynn commented 1 year ago

Interestingly enough, I found out they're added to the rfr service already. They are however not present on the rfs service.

Yeah, but the definition of the charts didn't have this declaration, so whether need to draft a PR for this.

I already use it in the real environment.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 45 days with no activity.

sagikazarmark commented 1 year ago

Not stale

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 45 days with no activity.

nantiferov commented 1 year ago

Not stale

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 45 days with no activity.

sagikazarmark commented 1 year ago

Not stale

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 45 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.