VictoriaMetrics/docs/operator/resources
Aliaksandr Valialkin 45cf83cd8f
Revert "docs: Add spellcheck workflow (#6470)"
This reverts commit 92b22581e6.

Reason for revert: too complex and slow approach for spellchecking task.

This approach may significantly slow down development pace. It also may take non-trivial
amounts of additional time and resources at CI/CD because of all this npm shit at cspell directory.

Note to @arkid15r : the idea with the ability to run spellchecker on all the VictoriaMetrics
codebase is great. But this shouldn't be mandatory pre-commit check. It is enough to have
a Makefile rule like `make spellcheck`, which could be run manually whenever spellcheck is needed
(e.g. once per month or once per quarter).
2024-06-25 02:23:48 +02:00
..
README.md Revert "docs: Add spellcheck workflow (#6470)" 2024-06-25 02:23:48 +02:00
README_cr-relations.png Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmagent.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmalert.md Automatic update operator docs from VictoriaMetrics/operator@73a1996 (#6100) 2024-04-13 10:04:25 +08:00
vmalertmanager.md chore(docs): fix vmalertmanager typo (#6056) 2024-04-03 11:02:30 +02:00
vmalertmanagerconfig.md Automatic update operator docs from VictoriaMetrics/operator@b96131b (#5371) 2023-11-22 03:59:07 -08:00
vmauth.md Automatic update operator docs from VictoriaMetrics/operator@8f025b3 (#6200) 2024-04-30 16:01:09 +08:00
vmcluster.md Automatic update operator docs from VictoriaMetrics/operator@4791fd1 (#5843) 2024-02-21 12:52:32 +01:00
vmnodescrape.md Automatic update operator docs from VictoriaMetrics/operator@b96131b (#5371) 2023-11-22 03:59:07 -08:00
vmpodscrape.md Automatic update operator docs from VictoriaMetrics/operator@b96131b (#5371) 2023-11-22 03:59:07 -08:00
vmprobe.md Automatic update operator docs from VictoriaMetrics/operator@b96131b (#5371) 2023-11-22 03:59:07 -08:00
vmrule.md docs: remove raw and endraw tags as they are not needed for the new v… (#5696) 2024-01-26 07:30:45 -08:00
vmscrapeconfig.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmservicescrape.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmsingle.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmstaticscrape.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00
vmuser.md Automatic update operator docs from VictoriaMetrics/operator@731de81 (#6139) 2024-04-18 10:25:29 +02:00

sort weight title menu
14 14 Custom resources
docs
identifier parent weight
operator-custom-resources operator 14

Custom resource kinds

This documentation section describes the design and interaction between the custom resource definitions (CRD) that the Victoria Metrics Operator introduces.

Operator introduces the following custom resources:

Here is the scheme of relations between the custom resources:

Specification

You can find the specification for the custom resources on API Docs.

Extra arguments

If you can't find necessary field in the specification of custom resource, you can use extraArgs field for passing additional arguments to the application.

Field extraArgs is supported for the following custom resources:

Supported flags for each application can be found the in the corresponding documentation:

Usage example:

apiVersion: operator.victoriametrics.com/v1beta1
kind: VMSingle
metadata:
  name: vmsingle-example-exrtaargs
spec:
  retentionPeriod: "1"
  extraArgs:
    dedup.minScrapeInterval: 60s
  # ...

Extra environment variables

Flag can be replaced with environment variable, it's useful for retrieving value from secret. You can use extraEnvs field for passing additional arguments to the application.

Usage example:

kind: VMSingle
metadata:
  name: vmsingle-example--exrtaenvs
spec:
  retentionPeriod: "1"
  extraEnvs:
    - name: DEDUP_MINSCRAPEINTERVAL
      valueFrom:
        secretKeyRef:
          name: vm-secret
          key: dedup

This feature really useful for using with -envflag.enable command-line argument.

Examples

Page for every custom resource contains examples section:

In addition, you can find examples of the custom resources for VIctoriMetrics operator in the examples directory of operator repository.

Managing versions of VM

Every custom resource with deployable application has a fields for specifying version (docker image) of component:

Managing resources

Every custom resource with deployable application has a fields and operator parameters for specifying resources for the component:

High availability

VictoriaMetrics operator support high availability for each component of the monitoring stack:

In addition, these CRD support common features, that can be used to increase high availability - resources above have the following fields:

See details about these fields in the Specification.

Enterprise features

Operator supports following Enterprise features for VictoriaMetrics components:

More information about enterprise features you can read on VictoriaMetrics Enterprise page.

Configuration synchronization

Basic concepts

VictoriaMetrics applications, like many other applications with configuration file deployed at Kubernetes, uses ConfigMaps and Secrets for configuration files. Usually, it's out of application scope to watch for configuration on-disk changes. Applications reload their configuration by a signal from a user or some other tool, that knows how to watch for updates. At Kubernetes, the most popular design for this case is a sidecar container, that watches for configuration file changes and sends an HTTP request to the application.

Configmap or Secret that mounted at Pod holds a copy of its content. Kubernetes component kubelet is responsible for content synchronization between an object at Kubernetes API and a file served on disk. It's not efficient to sync its content immediately, and kubelet eventually synchronizes it. There is a configuration option, that controls this period.

That's why, applications managed by operator don't receive changes immediately. It usually takes 1-2 min, before content will be updated.

It may trigger errors when an application was deleted, but VMAgent still tries to scrape it.

Possible mitigations

The naive solution for this case decrease the synchronization period. But it configures globally and may be hard for operator users.

That's why operator uses a few hacks.

For ConfigMap updates, operator changes annotation with a time of Configmap content update. It triggers ConfigMap's content synchronization by kubelet immediately. It's the case for VMAlert, it uses ConfigMap as a configuration source.

For Secret it doesn't work. And operator offers its implementation for side-car container. It can be configured with env variable for operator:

- name: VM_USECUSTOMCONFIGRELOADER
  value: "true"

If it's defined, operator uses own config-reloader instead of prometheus-config-reload.

It watches corresponding Secret for changes with Kubernetes API watch call and writes content into emptyDir. This emptyDir shared with the application. In case of content changes, config-reloader sends HTTP requests to the application. It greatly reduces the time for configuration synchronization.