Version ArtifactHub License Slack X Reddit

Victoria Metrics Anomaly Detection - a service that continuously scans Victoria Metrics time series and detects unexpected changes within data patterns in real-time.

Prerequisites #

  • Install the follow packages: git, kubectl, helm, helm-docs. See this tutorial.

  • PV support on underlying infrastructure

Chart Details #

This chart will do the following:

  • Rollout victoria metrics anomaly

How to install #

Access a Kubernetes cluster.

Setup chart repository (can be omitted for OCI repositories) #

Add a chart helm repository with follow commands:

              1
2
3
4
            
              helm repo add vm https://victoriametrics.github.io/helm-charts/

helm repo update

            

List versions of vm/victoria-metrics-anomaly chart available to installation:

              1
2
            
              helm search repo vm/victoria-metrics-anomaly -l

            

Install victoria-metrics-anomaly chart #

Export default values of victoria-metrics-anomaly chart to file values.yaml:

  • For HTTPS repository

                  1
    2
                
                  helm show values vm/victoria-metrics-anomaly > values.yaml
    
                
  • For OCI repository

                  1
    2
                
                  helm show values oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-anomaly > values.yaml
    
                

Change the values according to the need of the environment in values.yaml file.

Test the installation with command:

  • For HTTPS repository

                  1
    2
                
                  helm install vma vm/victoria-metrics-anomaly -f values.yaml -n NAMESPACE --debug --dry-run
    
                
  • For OCI repository

                  1
    2
                
                  helm install vma oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-anomaly -f values.yaml -n NAMESPACE --debug --dry-run
    
                

Install chart with command:

  • For HTTPS repository

                  1
    2
                
                  helm install vma vm/victoria-metrics-anomaly -f values.yaml -n NAMESPACE
    
                
  • For OCI repository

                  1
    2
                
                  helm install vma oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-anomaly -f values.yaml -n NAMESPACE
    
                

Get the pods lists by running this commands:

              1
2
            
              kubectl get pods -A | grep 'vma'

            

Get the application by running this command:

              1
2
            
              helm list -f vma -n NAMESPACE

            

See the history of versions of vma application with command.

              1
2
            
              helm history vma -n NAMESPACE

            

How to uninstall #

Remove application with command.

              1
2
            
              helm uninstall vma -n NAMESPACE

            

Documentation of Helm Chart #

Install helm-docs following the instructions on this tutorial.

Generate docs with helm-docs command.

              1
2
3
            
              cd charts/victoria-metrics-anomaly

helm-docs
            

The markdown generation is entirely go template driven. The tool parses metadata from charts and generates a number of sub-templates that can be referenced in a template file (by default README.md.gotmpl). If no template file is provided, the tool has a default internal template that will generate a reasonably formatted README.

Parameters #

The following tables lists the configurable parameters of the chart and their default values.

For more vmanomaly config parameters see https://docs.victoriametrics.com/anomaly-detection/components

Change the values according to the need of the environment in victoria-metrics-anomaly/values.yaml file.

KeyDescription
affinity: {}
(object)

Affinity configurations

annotations: {}
(object)

Annotations to be added to the deployment

config:
    models: {}
    preset: ""
    reader:
        class: vm
        datasource_url: ""
        queries: {}
        sampling_period: 1m
        tenant_id: ""
    schedulers: {}
    writer:
        class: vm
        datasource_url: ""
        tenant_id: ""
(object)

Full vmanomaly config section

config.models: {}
(object)

Models section

config.preset: ""
(string)

Whether to use preset configuration. If not empty, preset name should be specified.

config.reader:
    class: vm
    datasource_url: ""
    queries: {}
    sampling_period: 1m
    tenant_id: ""
(object)

Reader section

config.reader.class: vm
(string)

Name of the class needed to enable reading from VictoriaMetrics or Prometheus. VmReader is the default option, if not specified.

config.reader.datasource_url: ""
(string)

Datasource URL address. Required for example http://single-victoria-metrics-single-server.default.svc.cluster.local:8428 or http://cluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480

config.reader.queries: {}
(object)

Required. PromQL/MetricsQL query to select data in format: QUERY_ALIAS: “QUERY”. As accepted by “/query_range?query=%s”. See here for more details.

config.reader.sampling_period: 1m
(string)

Frequency of the points returned. Will be converted to /query_range?step=%s param (in seconds). Required since 1.9.0.

config.reader.tenant_id: ""
(string)

For VictoriaMetrics Cluster version only, tenants are identified by accountID or accountID:projectID. See VictoriaMetrics Cluster multitenancy docs

config.schedulers: {}
(object)

Scheduler section

config.writer:
    class: vm
    datasource_url: ""
    tenant_id: ""
(object)

Writer section

config.writer.class: vm
(string)

Name of the class needed to enable writing to VictoriaMetrics or Prometheus. VmWriter is the default option, if not specified.

config.writer.datasource_url: ""
(string)

Datasource URL address. Required for example http://single-victoria-metrics-single-server.default.svc.cluster.local:8428 or http://cluster-victoria-metrics-cluster-vminsert.default.svc.cluster.local:8480

config.writer.tenant_id: ""
(string)

For VictoriaMetrics Cluster version only, tenants are identified by accountID or accountID:projectID. See VictoriaMetrics Cluster multitenancy docs

configMapAnnotations: {}
(object)

Annotations to be added to configMap

containerWorkingDir: /vmanomaly
(string)

Container working directory

emptyDir: {}
(object)

Empty dir configuration when persistence is disabled

env: []
(list)

Additional environment variables (ex.: secret tokens, flags)

envFrom: []
(list)

Specify alternative source for env variables

extraArgs: {}
(object)

Extra command line arguments for container of component

extraContainers: []
(list)

Extra containers to run in a pod with anomaly container

extraHostPathMounts: []
(list)

Additional hostPath mounts

extraObjects: []
(list)

Add extra specs dynamically to this chart

extraVolumeMounts: []
(list)

Extra Volume Mounts for the container

extraVolumes: []
(list)

Extra Volumes for the pod

fullnameOverride: ""
(string)

Override resources fullname

global.cluster.dnsDomain: cluster.local.
(string)

K8s cluster domain suffix, uses for building storage pods’ FQDN. Details are here

global.compatibility:
    openshift:
        adaptSecurityContext: auto
(object)

Openshift security context compatibility configuration

global.image.registry: ""
(string)

Image registry, that can be shared across multiple helm charts

global.imagePullSecrets: []
(list)

Image pull secrets, that can be shared across multiple helm charts

image.pullPolicy: IfNotPresent
(string)

Pull policy of Docker image

image.registry: ""
(string)

Victoria Metrics anomaly Docker registry

image.repository: victoriametrics/vmanomaly
(string)

Victoria Metrics anomaly Docker repository and image name

image.tag: ""
(string)

Tag of Docker image

imagePullSecrets: []
(list)

Image pull secrets

license:
    key: ""
    secret:
        key: ""
        name: ""
(object)

License key configuration for vmanomaly. See docs Required starting from v1.5.0.

license.key: ""
(string)

License key for vmanomaly

license.secret:
    key: ""
    name: ""
(object)

Use existing secret with license key for vmanomaly

license.secret.key: ""
(string)

Key in secret with license key

license.secret.name: ""
(string)

Existing secret name

nameOverride: ""
(string)

Override chart name

nodeSelector: {}
(object)

NodeSelector configurations. Details are here

persistentVolume:
    accessModes:
        - ReadWriteOnce
    annotations: {}
    dumpData: true
    dumpModels: true
    enabled: false
    existingClaim: ""
    matchLabels: {}
    size: 1Gi
    storageClassName: ""
(object)

Persistence to store models on disk. Available starting from v1.13.0

persistentVolume.accessModes:
    - ReadWriteOnce
(list)

Array of access modes. Must match those of existing PV or dynamic provisioner. Details are here

persistentVolume.annotations: {}
(object)

Persistent volume annotations

persistentVolume.dumpData: true
(bool)

Enables dumpling data which is fetched from VictoriaMetrics to persistence disk. This is helpful to reduce memory usage.

persistentVolume.dumpModels: true
(bool)

Enables dumping models to persistence disk. This is helpful to reduce memory usage.

persistentVolume.enabled: false
(bool)

Create/use Persistent Volume Claim for models dump.

persistentVolume.existingClaim: ""
(string)

Existing Claim name. If defined, PVC must be created manually before volume will be bound

persistentVolume.matchLabels: {}
(object)

Bind Persistent Volume by labels. Must match all labels of targeted PV.

persistentVolume.size: 1Gi
(string)

Size of the volume. Should be calculated based on the metrics you send and retention policy you set.

persistentVolume.storageClassName: ""
(string)

StorageClass to use for persistent volume. Requires server.persistentVolume.enabled: true. If defined, PVC created automatically

podAnnotations: {}
(object)

Annotations to be added to pod

podDisruptionBudget:
    enabled: false
    labels: {}
    minAvailable: 1
(object)

See kubectl explain poddisruptionbudget.spec for more. Details are here

podLabels: {}
(object)

Labels to be added to pod

podMonitor.annotations: {}
(object)

PodMonitor annotations

podMonitor.enabled: false
(bool)

Enable PodMonitor

podMonitor.extraLabels: {}
(object)

PodMonitor labels

podSecurityContext:
    enabled: true
    fsGroup: 1000
(object)

Pod’s security context. Details are here

replicationFactor: 1
(int)

Number of replicas for sharding. Must be greater than 0. Details are here

resources: {}
(object)

Resource object. Details are here

securityContext:
    enabled: true
    runAsGroup: 1000
    runAsNonRoot: true
    runAsUser: 1000
(object)

Check here for details.

serviceAccount.annotations: {}
(object)

Annotations to add to the service account

serviceAccount.create: true
(bool)

Specifies whether a service account should be created

serviceAccount.name: null
(string)

The name of the service account to use. If not set and create is true, a name is generated using the fullname template

shardsCount: 1
(int)

Total number of shards. Must be greater than 0. Details are here

tolerations: []
(list)

Tolerations configurations. Details are here