MCPcopy Index your code
hub / github.com/VictoriaMetrics/operator

github.com/VictoriaMetrics/operator @v0.72.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.72.0 ↗ · + Follow
4,525 symbols 15,995 edges 506 files 2,680 documented · 59% 1 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Latest Release Docker Pulls Slack GitHub license Go Report Build and Test Status

VictoriaMetrics logo

VictoriaMetrics operator

Overview

Design and implementation inspired by prometheus-operator. It's great a tool for managing monitoring configuration of your applications. VictoriaMetrics operator has api capability with it. So you can use familiar CRD objects: ServiceMonitor, PodMonitor, PrometheusRule, Probe and ScrapeConfig. Or you can use VictoriaMetrics CRDs:

  • VMServiceScrape - defines scraping metrics configuration from pods backed by services.
  • VMPodScrape - defines scraping metrics configuration from pods.
  • VMRule - defines alerting or recording rules.
  • VMProbe - defines a probing configuration for targets with blackbox exporter.
  • VMScrapeConfig - define a scrape config using any of the service discovery options supported in victoriametrics.

Besides, operator allows you to manage VictoriaMetrics applications inside kubernetes cluster and simplifies this process quick-start With CRD (Custom Resource Definition) you can define application configuration and apply it to your cluster crd-objects.

Operator simplifies VictoriaMetrics cluster installation, upgrading and managing.

It has integration with VictoriaMetrics vmbackupmanager - advanced tools for making backups. Check Backup automation for VMSingle or Backup automation for VMCluster.

Use cases

For kubernetes-cluster administrators, it simplifies installation, configuration, management for VictoriaMetrics application. And the main feature of operator - is ability to delegate applications monitoring configuration to the end-users.

For applications developers, its great possibility for managing observability of applications. You can define metrics scraping and alerting configuration for your application and manage it with an application deployment process. Just define app_deployment.yaml, app_vmpodscrape.yaml and app_vmrule.yaml. That's it, you can apply it to a kubernetes cluster. Check quick-start for an example.

Operator vs helm-chart

VictoriaMetrics provides helm charts. Operator makes the same, simplifies it and provides advanced features.

Documentation

  • quick start doc
  • high availability doc
  • relabeling configuration doc
  • managing crd objects versions doc
  • design and description of implementation design
  • operator objects description doc
  • backups docs
  • external access to cluster resourcesdoc
  • security doc
  • resource validation doc

Configuration

Operator configured by env variables, list of it can be found at link

It defines default configuration options, like images for components, timeouts, features.

Kubernetes' compatibility versions

operator tested on officially supported Kubernetes versions

Community and contributions

Feel free asking any questions regarding VictoriaMetrics:

Development

Dependencies:

  • kubebuilder v4
  • golang 1.23+
  • kubectl
  • docker

start:

make run

to run unit tests

make test

to run e2e tests on automatically configured Kind cluster

# make test-e2e

Extension points exported contracts — how you extend this code

StatusWithMetadata (Interface)
StatusWithMetadata defines [286 implementers]
internal/controller/operator/factory/reconcile/status.go
GenericInformer (Interface)
GenericInformer is type of SharedIndexInformer which will locate and delegate to other sharedInformers based on type [24 …
api/client/informers/externalversions/generic.go
ObjectWithDeepCopyAndStatus (Interface)
(no doc) [24 implementers]
internal/controller/operator/factory/reconcile/status.go
VMAlertmanagerConfigInformer (Interface)
VMAlertmanagerConfigInformer provides access to a shared informer and lister for VMAlertmanagerConfigs. [24 implementers]
api/client/informers/externalversions/operator/v1beta1/vmalertmanagerconfig.go
VMSingleInformer (Interface)
VMSingleInformer provides access to a shared informer and lister for VMSingles. [24 implementers]
api/client/informers/externalversions/operator/v1beta1/vmsingle.go
VMNodeScrapeInformer (Interface)
VMNodeScrapeInformer provides access to a shared informer and lister for VMNodeScrapes. [24 implementers]
api/client/informers/externalversions/operator/v1beta1/vmnodescrape.go
VMAlertmanagerInformer (Interface)
VMAlertmanagerInformer provides access to a shared informer and lister for VMAlertmanagers. [24 implementers]
api/client/informers/externalversions/operator/v1beta1/vmalertmanager.go

Core symbols most depended-on inside this repo

Get
called by 850
api/client/listers/operator/v1/vlagent.go
PrefixedName
called by 503
internal/controller/operator/factory/vmscrapes/extra_config.go
set
called by 318
internal/controller/operator/factory/vmalertmanager/config.go
String
called by 246
internal/config/config.go
Create
called by 231
api/client/versioned/typed/operator/v1/vlagent.go
AsOwner
called by 168
internal/controller/operator/factory/vmscrapes/extra_config.go
Scheme
called by 161
internal/controller/operator/vlogs_controller.go
Info
called by 136
internal/controller/operator/factory/logger/logger.go

Shape

Method 2,317
Function 1,207
Struct 745
Interface 213
TypeAlias 40
FuncType 3

Languages

Go100%
Python1%

Modules by API surface

api/operator/v1beta1/zz_generated.deepcopy.go484 symbols
api/operator/v1/zz_generated.deepcopy.go118 symbols
api/operator/v1beta1/vmalertmanagerconfig_types.go105 symbols
api/operator/v1beta1/vmextra_types.go94 symbols
api/operator/v1beta1/vmcluster_types.go82 symbols
api/operator/v1/vlcluster_types.go64 symbols
api/operator/v1/vtcluster_types.go59 symbols
api/operator/v1beta1/vmagent_types.go51 symbols
api/operator/v1beta1/vmauth_types.go49 symbols
api/operator/v1beta1/vmalertmanager_types.go47 symbols
api/operator/v1/vmanomaly_types.go47 symbols
internal/converter/converter.go45 symbols

Used by 1 indexed graphs manifest dependencies, hub-wide

For agents

$ claude mcp add operator \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact