VictoriaMetrics / operator

Kubernetes operator for Victoria Metrics
Apache License 2.0
410 stars 141 forks source link

can i convert scrape config to VMPodScrape cr? #923

Open hkmdxlftjf opened 3 months ago

hkmdxlftjf commented 3 months ago

Hello, I would like to write code to convert existing configurations to VMPodScrape/VMNodeScrape. Is there any way to achieve this? Are there any codes that I can refer to? Thanks!

Haleygo commented 3 months ago

Hello! Yes, vm-operator automatically convert existing Prometheus ServiceMonitor, PodMonitor, PrometheusRule, Probe and ScrapeConfig objects into corresponding VictoriaMetrics Operator objects by default. Check this doc for details. Code can be found in https://github.com/VictoriaMetrics/operator/blob/master/controllers/converter/apis.go.