operator icon indicating copy to clipboard operation
operator copied to clipboard

Question regarding VictoriaMetrics Operator CRD and Prometheus Operator CRD

Open Hazmi35 opened this issue 1 year ago • 2 comments

The docs specified that: So you can use familiar CRD objects: ServiceMonitor, PodMonitor, PrometheusRule, Probe and AlertmanagerConfig..

And there is also an auto-conversion of Prom Operator CRD to VM Operator CRD, it also syncs but the docs also specified that: It DOES NOT delete converted objects after original ones are deleted.

My use-case here is to use VM Operator CRDs for my own apps/metrics, but use Prometheus Operator CRDs for Helm Charts that I cannot modify myself without forking (one such case is CloudNative-PG, it uses PodMonitor). Although the auto-conversion really helps here but the fact that the converted object will not be deleted after the original ones is deleted is kinda no no for me.

My question is,

  1. Does this operator supports reading ServiceMonitor/PodMonitor without auto-conversion but still treats them the same way as VMServiceScrape/VMPodScrape? (In my setup, I tried. It doesn't scrape any ServiceMonitor/PodMonitor)
  2. Would a support for an auto-deleted converted objects from auto-conversion be possible?

Hazmi35 avatar Sep 30 '24 14:09 Hazmi35

The question might not be relevant anymore, but regarding the deletion of converted object this setting does actually exactly this.

sdomme avatar Nov 08 '24 12:11 sdomme

The question might not be relevant anymore, but regarding the deletion of converted object this setting does actually exactly this.

Oh! Didn't catch that. Is that new? Well perhaps it's because I used the victoria-metrics-k8s-stack chart which omits that option from the default values file.

The docs are still saying It DOES NOT delete converted objects after original ones are deleted. though.

Hazmi35 avatar Nov 08 '24 15:11 Hazmi35

this option is not omitted, since operator chart is a dependency of k8s stack. to set this value you need to set it under victoria-metrics-operator key:

victoria-metrics-operator:
  operator:
    enable_converter_ownership: true

AndrewChubatiuk avatar Oct 31 '25 16:10 AndrewChubatiuk

closing as answered

AndrewChubatiuk avatar Oct 31 '25 16:10 AndrewChubatiuk