VictoriaMetrics Operator

repository·master·Indexed 20 days ago

https://github.com/victoriametrics/operator

A Kubernetes-native tool (vmoperator) for the declarative deployment and management of VictoriaMetrics applications, including vmsingle, vmcluster, vmauth, vmagent, and vmalert. It utilizes Custom Resource Definitions (CRDs) to automate the lifecycle of monitoring, alerting, and scraping components, supporting GitOps and Infrastructure as Code principles. Key features include Prometheus-operator migration, integrated backup automation via vmbackupmanager, and a specialized config-reloader for faster Kubernetes secret synchronization.

Tokens
217.2K
Snippets
338
Records
719
Agent score
68%

What's inside VictoriaMetrics Operator

  1. Overview of VictoriaMetrics Operator

    master

    The VictoriaMetrics operator is a tool designed to simplify the installation, configuration, management, and upgrading of VictoriaMetrics applications within a Kubernetes cluster. Inspired by the prometheus-operator, it allows cluster administrators to manage the VictoriaMetrics lifecycle while delegating monitoring configuration to application developers.

    Key capabilities include:

    • Automated Lifecycle Management: Simplifies cluster installation and upgrades.
    • Monitoring Delegation: Enables developers to manage their own observability by defining scraping and alerting rules via CRDs.
    • Backup Integration: Integrates with vmbackupmanager for advanced backup automation for VMSingle and VMCluster resources.
  2. Overview of VictoriaMetrics Operator (vmoperator)

    master

    The VictoriaMetrics Operator (vmoperator) is a Kubernetes-native tool designed to manage VictoriaMetrics applications (such as vmsingle, vmcluster, vmauth, vmagent, and vmalert) in a declarative style. It follows GitOps and Infrastructure as Code (IaC) principles, allowing users to manage complex VictoriaMetrics deployments using Kubernetes Custom Resources.

    Key capabilities include:

    • Declarative Management: Deploy and manage any number of VictoriaMetrics components via CRDs.
    • Prometheus Migration: Seamlessly migrate from prometheus-operator using automatic conversion of Prometheus custom resources.
    • Backup Integration: Integrated with vmbackupmanager for advanced backup automation for VMSingle and VMCluster.
    • Configuration Delegation: Allows delegating specific parts of monitoring configurations to end-users while managing access to different sections.
    • Ready-to-use Stacks: Provides the k8s-stack Helm chart for out-of-the-box monitoring solutions.
  3. Available Enterprise features for VictoriaMetrics components

    master

    The VictoriaMetrics Operator supports various Enterprise features across its managed components. These features provide advanced capabilities such as Kafka integration, multitenancy, and enhanced data retention management.

    Key Enterprise features include:

    • VMAgent: Reading/writing metrics from/to Kafka.
    • VMAlert: Reading rules from object storage and multitenancy.
    • VMAuth: IP Filters.
    • VMCluster: Downsampling, multiple retentions/retention filters, advanced per-tenant statistics, mTLS protection, and backup automation.
    • VMRule: Multitenancy.
    • VMSingle: Downsampling, retention filters, and backup automation.
    • VMUser: IP Filters.
  4. Integrations for VictoriaMetrics Operator

    master

    The VictoriaMetrics Operator provides comprehensive Kubernetes guides for deploying and using VictoriaMetrics alongside common ecosystem tools. Available integration guides include:

    • Prometheus: Guidance on migrating from Prometheus to VictoriaMetrics.
    • Grafana: Instructions for using VictoriaMetrics as a data source in Grafana.
    • Istio: Deployment and usage guides for VictoriaMetrics within Istio environments.
  5. Understand Enterprise feature support in VictoriaMetrics Operator

    master

    The VictoriaMetrics Operator itself does not have an enterprise version, but it is designed to manage and deploy VictoriaMetrics components that include enterprise-grade features.

    Supported enterprise features across different components include:

    • VMAgent: Kafka integration (reading metrics from and writing metrics to Kafka).
    • VMAlert: Reading rules from object storage and Multitenancy.
    • VMAuth: IP Filters.
    • VMCluster: Downsampling, Multiple retentions / Retention filters, Advanced per-tenant statistics, mTLS protection, and Backup automation.
    • VMRule: Multitenancy.
    • VMSingle: Downsampling, Retention filters, and Backup automation.
    • VMUser: IP Filters.

    For specific implementation details and deployment examples for enterprise components using the operator, refer to the VictoriaMetrics Enterprise documentation.

  6. What is Config-reloader?

    master
    Config-reloader is an alternative to prometheus-config-reloader. Its primary feature is the ability to read secrets directly from Kubernetes and write them to the local file system. This approach is designed to speed up the configuration reloading process and make it more predictable compared to standard methods.
  7. What is VMSingle and how does it work?

    master

    The VMSingle Custom Resource (CR) declaratively defines a single-node VictoriaMetrics installation running in a Kubernetes cluster.

    When you create a VMSingle resource, the Operator performs the following actions:

    • Deploys a Deployment in the same namespace.
    • Configures Pods to mount either an emptyDir or a PersistentVolumeClaimSpec for data storage.
    • Sets the Deployment update strategy to recreate.
    • Ensures no more than one replica is running.
    • Adds a Service and a VMServiceScrape object in the same namespace, prefixed with the VMSingle.metadata.name.

    Note: VMSingle does not support high availability. For HA requirements, use VMCluster or duplicate the setup.

  8. What is the VLDistributed Custom Resource?

    master

    VLDistributed is a Custom Resource Definition (CRD) used to orchestrate updates for multiple VictoriaLogs clusters or single-node instances. It manages the lifecycle and sequential updates of distributed VictoriaLogs components (like VLAgent, VLCluster, or VLSingle) to ensure high availability and minimal disruption during changes.

    Warning: VLDistributed is currently an experimental feature. The API is not yet stabilized and may change in future releases. It may not be suitable for production environments.

  9. What is VMProbe and how does it work?

    master

    The VMProbe Custom Resource Definition (CRD) allows you to define probing targets using an external prober, most commonly the blackbox exporter.

    When you create a VMProbe object, the operator automatically generates and syncs the necessary configuration for a VMAgent. This allows you to monitor the availability and health of services using either static targets or Kubernetes discovery mechanisms (like Ingress).

    Requirements for use:

    1. Configure a Blackbox Exporter: You must have a blackbox exporter running and configured (e.g., via a ConfigMap) before using VMProbe.
    2. VMAgent Selector Match: Your VMAgent must be configured with a probeSelector that matches the labels or namespace of your VMProbe object so that the agent knows to pick up the new probing configuration.
  10. What is a VMRule?

    master

    A VMRule is a Custom Resource Definition (CRD) used to declaratively define alerting or recording rules for VMAlert instances.

    When you create a VMRule object, the operator generates a VMAlert instance configured with the ruleset defined in the spec. Rules can be saved as YAML files and loaded dynamically without requiring a restart of the VMAlert instances.

  11. What is a VTSingle?

    master

    A VTSingle is a Custom Resource (CR) that declaratively defines a single-node VictoriaTraces installation in a Kubernetes cluster.

    When you create a VTSingle resource, the Operator automatically deploys:

    1. A Deployment in the same namespace (using a recreate update strategy).
    2. A Service prefixed with the VTSingle name.
    3. A VMServiceScrape prefixed with the VTSingle name.

    Note on High Availability: VTSingle does not support high availability. It is limited to a maximum of one replica. For high availability, use VTCluster or deploy multiple VTSingle resources.

  12. What is VLSingle?

    master

    VLSingle is a Custom Resource Definition (CRD) used to declaratively define a single-node VictoriaLogs installation within a Kubernetes cluster.

    When you create a VLSingle resource, the Operator performs the following actions:

    • Deploys a Deployment in the same namespace with a recreate update strategy.
    • Configures Pods to mount either an emptyDir or a PersistentVolumeClaimSpec for data storage.
    • Limits the deployment to a maximum of one replica.
    • Adds a Service and a VMServiceScrape resource in the same namespace, prefixed with the VLSingle.metadata.name.