Type: application Version: 0.13.3 Artifact Hub Slack

Victoria Metrics Alert - executes a list of given MetricsQL expressions (rules) and sends alerts to Alert Manager.

Prerequisites #

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

How to install #

Access a Kubernetes cluster.

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

Add a chart helm repository with follow commands:

helm repo add vm https://victoriametrics.github.io/helm-charts/

helm repo update

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

helm search repo vm/victoria-metrics-alert -l

Install victoria-metrics-alert chart #

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

  • For HTTPS repository

    helm show values vm/victoria-metrics-alert > values.yaml
    
  • For OCI repository

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

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

Test the installation with command:

  • For HTTPS repository

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

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

Install chart with command:

  • For HTTPS repository

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

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

Get the pods lists by running this commands:

kubectl get pods -A | grep 'vma'

Get the application by running this command:

helm list -f vma -n NAMESPACE

See the history of versions of vma application with command.

helm history vma -n NAMESPACE

HA configuration for Alertmanager #

There is no option on this chart to set up Alertmanager with HA mode. To enable the HA configuration, you can use:

How to uninstall #

Remove application with command.

helm uninstall vma -n NAMESPACE

Documentation of Helm Chart #

Install helm-docs following the instructions on this tutorial.

Generate docs with helm-docs command.

cd charts/victoria-metrics-alert

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.

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

KeyTypeDefaultDescription
alertmanager.baseURLstring
""

External URL, that alertmanager will expose to receivers

alertmanager.baseURLPrefixstring
""

External URL Prefix, Prefix for the internal routes of web endpoints

alertmanager.configobject
global:
    resolve_timeout: 5m
receivers:
    - name: devnull
route:
    group_by:
        - alertname
    group_interval: 10s
    group_wait: 30s
    receiver: devnull
    repeat_interval: 24h

Alertmanager configuration

alertmanager.configMapstring
""

Use existing configmap if specified otherwise .config values will be used

alertmanager.emptyDirobject
{}

Empty dir configuration if persistence is disabled for Alertmanager

alertmanager.enabledbool
false

Create alertmanager resources

alertmanager.envFromlist
[]

Specify alternative source for env variables

alertmanager.extraArgsobject
{}

Extra command line arguments for container of component

alertmanager.extraContainerslist
[]

Extra containers to run in a pod with alertmanager

alertmanager.extraHostPathMountslist
[]

Additional hostPath mounts

alertmanager.extraVolumeMountslist
[]

Extra Volume Mounts for the container

alertmanager.extraVolumeslist
[]

Extra Volumes for the pod

alertmanager.fullnameOverridestring
""

Override Alertmanager resources fullname

alertmanager.imageobject
registry: ""
repository: prom/alertmanager
tag: v0.27.0

Alertmanager image configuration

alertmanager.imagePullSecretslist
[]

Image pull secrets

alertmanager.ingress.annotationsobject
{}

Ingress annotations

alertmanager.ingress.enabledbool
false

Enable deployment of ingress for alertmanager component

alertmanager.ingress.extraLabelsobject
{}

Ingress extra labels

alertmanager.ingress.hostslist
- name: alertmanager.local
  path:
    - /
  port: web

Array of host objects

alertmanager.ingress.ingressClassNamestring
""

Ingress controller class name

alertmanager.ingress.pathTypestring
Prefix

Ingress path type

alertmanager.ingress.tlslist
[]

Array of TLS objects

alertmanager.initContainerslist
[]

Additional initContainers to initialize the pod

alertmanager.listenAddressstring
0.0.0.0:9093

Alertmanager listen address

alertmanager.nodeSelectorobject
{}

Pod’s node selector. Details are here

alertmanager.persistentVolume.accessModeslist
- ReadWriteOnce

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

alertmanager.persistentVolume.annotationsobject
{}

Persistant volume annotations

alertmanager.persistentVolume.enabledbool
false

Create/use Persistent Volume Claim for alertmanager component. Empty dir if false

alertmanager.persistentVolume.existingClaimstring
""

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

alertmanager.persistentVolume.mountPathstring
/data

Mount path. Alertmanager data Persistent Volume mount root path.

alertmanager.persistentVolume.sizestring
50Mi

Size of the volume. Better to set the same as resource limit memory property.

alertmanager.persistentVolume.storageClassNamestring
""

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

alertmanager.persistentVolume.subPathstring
""

Mount subpath

alertmanager.podAnnotationsobject
{}

Alertmanager Pod annotations

alertmanager.podLabelsobject
{}

Alertmanager Pod labels

alertmanager.podSecurityContextobject
enabled: false

Pod’s security context. Details are here

alertmanager.priorityClassNamestring
""

Name of Priority Class

alertmanager.probe.livenessobject
httpGet:
    path: '{{ ternary "" .baseURLPrefix (empty .baseURLPrefix) }}/-/healthy'
    port: web

Liveness probe

alertmanager.probe.readinessobject
httpGet:
    path: '{{ ternary "" .baseURLPrefix (empty .baseURLPrefix) }}/-/ready'
    port: web

Readiness probe

alertmanager.probe.startupobject
httpGet:
    path: '{{ ternary "" .baseURLPrefix (empty .baseURLPrefix) }}/-/ready'
    port: web

Startup probe

alertmanager.resourcesobject
{}

Resource object. Details are here

alertmanager.retentionstring
120h

Alertmanager retention

alertmanager.securityContextobject
enabled: false

Security context to be added to server pods

alertmanager.service.annotationsobject
{}

Service annotations

alertmanager.service.clusterIPstring
""

Service ClusterIP

alertmanager.service.externalIPslist
[]

Service external IPs. Check here for details

alertmanager.service.externalTrafficPolicystring
""

Service external traffic policy. Check here for details

alertmanager.service.healthCheckNodePortstring
""

Health check node port for a service. Check here for details

alertmanager.service.ipFamilieslist
[]

List of service IP families. Check here for details.

alertmanager.service.ipFamilyPolicystring
""

Service IP family policy. Check here for details.

alertmanager.service.labelsobject
{}

Service labels

alertmanager.service.loadBalancerIPstring
""

Service load balancer IP

alertmanager.service.loadBalancerSourceRangeslist
[]

Load balancer source range

alertmanager.service.servicePortint
9093

Service port

alertmanager.service.typestring
ClusterIP

Service type

alertmanager.templatesobject
{}

Alertmanager extra templates

alertmanager.tolerationslist
[]

Node tolerations for server scheduling to nodes with taints. Details are here

alertmanager.webConfigobject
{}

Alertmanager web configuration

extraObjectslist
[]

Add extra specs dynamically to this chart

global.cluster.dnsDomainstring
cluster.local.

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

global.compatibilityobject
openshift:
    adaptSecurityContext: auto

Openshift security context compatibility configuration

global.image.registrystring
""

Image registry, that can be shared across multiple helm charts

global.imagePullSecretslist
[]

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

licenseobject
key: ""
secret:
    key: ""
    name: ""

Enterprise license key configuration for VictoriaMetrics enterprise. Required only for VictoriaMetrics enterprise. Check docs here, for more information, visit site. Request a trial license here Supported starting from VictoriaMetrics v1.94.0

license.keystring
""

License key

license.secretobject
key: ""
name: ""

Use existing secret with license key

license.secret.keystring
""

Key in secret with license key

license.secret.namestring
""

Existing secret name

nameOverridestring
""

Override chart name

server.affinityobject
{}

Pod affinity

server.annotationsobject
{}

Annotations to be added to the deployment

server.configobject
alerts:
    groups: []

VMAlert configuration

server.configMapstring
""

VMAlert alert rules configuration. Use existing configmap if specified

server.datasourceobject
basicAuth:
    password: ""
    username: ""
bearer:
    token: ""
    tokenFile: ""
url: ""

VMAlert reads metrics from source, next section represents its configuration. It can be any service which supports MetricsQL or PromQL.

server.datasource.basicAuthobject
password: ""
username: ""

Basic auth for datasource

server.datasource.bearer.tokenstring
""

Token with Bearer token. You can use one of token or tokenFile. You don’t need to add “Bearer” prefix string

server.datasource.bearer.tokenFilestring
""

Token Auth file with Bearer token. You can use one of token or tokenFile

server.envlist
[]

Additional environment variables (ex.: secret tokens, flags). Check here for details.

server.envFromlist
[]

Specify alternative source for env variables

server.extraArgsobject
envflag.enable: true
envflag.prefix: VM_
httpListenAddr: :8880
loggerFormat: json
rule:
    - /config/alert-rules.yaml

Extra command line arguments for container of component

server.extraContainerslist
[]

Additional containers to run in the same pod

server.extraHostPathMountslist
[]

Additional hostPath mounts

server.extraVolumeMountslist
[]

Extra Volume Mounts for the container. Expects a lice of volume mounts

server.extraVolumeslist
[]

Extra Volumes for the pod

server.fullnameOverridestring
""

Override vmalert resources fullname

server.imageobject
pullPolicy: IfNotPresent
registry: ""
repository: victoriametrics/vmalert
tag: ""
variant: ""

VMAlert image configuration

server.imagePullSecretslist
[]

Image pull secrets

server.ingress.annotationsobject
{}

Ingress annotations

server.ingress.enabledbool
false

Enable deployment of ingress for vmalert component

server.ingress.extraLabelsobject
{}

Ingress extra labels

server.ingress.hostslist
- name: vmalert.local
  path:
    - /
  port: http

Array of host objects

server.ingress.ingressClassNamestring
""

Ingress controller class name

server.ingress.pathTypestring
Prefix

Ingress path type

server.ingress.tlslist
[]

Array of TLS objects

server.initContainerslist
[]

Additional initContainers to initialize the pod

server.labelsobject
{}

Labels to be added to the deployment

server.minReadySecondsint
0

Specifies the minimum number of seconds for which a newly created Pod should be ready without any of its containers crashing/terminating 0 is the standard k8s default

server.namestring
""

Override default app label name

server.nodeSelectorobject
{}

Pod’s node selector. Details are here

server.notifierobject
alertmanager:
    basicAuth:
        password: ""
        username: ""
    bearer:
        token: ""
        tokenFile: ""
    url: ""

Notifier to use for alerts. Multiple notifiers can be enabled by using notifiers section

server.notifier.alertmanager.basicAuthobject
password: ""
username: ""

Basic auth for alertmanager

server.notifier.alertmanager.bearer.tokenstring
""

Token with Bearer token. You can use one of token or tokenFile. You don’t need to add “Bearer” prefix string

server.notifier.alertmanager.bearer.tokenFilestring
""

Token Auth file with Bearer token. You can use one of token or tokenFile

server.notifierslist
[]

Additional notifiers to use for alerts

server.podAnnotationsobject
{}

Annotations to be added to pod

server.podDisruptionBudgetobject
enabled: false
labels: {}

See kubectl explain poddisruptionbudget.spec for more. Or check docs

server.podLabelsobject
{}

Pod’s additional labels

server.podSecurityContextobject
enabled: true

Pod’s security context. Details are here

server.priorityClassNamestring
""

Name of Priority Class

server.probe.livenessobject
failureThreshold: 3
initialDelaySeconds: 5
periodSeconds: 15
tcpSocket: {}
timeoutSeconds: 5

Liveness probe

server.probe.readinessobject
failureThreshold: 3
httpGet: {}
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5

Readiness probe

server.probe.startupobject
{}

Startup probe

server.remote.read.basicAuthobject
password: ""
username: ""

Basic auth for remote read

server.remote.read.bearerobject
token: ""
tokenFile: ""

Auth based on Bearer token for remote read

server.remote.read.bearer.tokenstring
""

Token with Bearer token. You can use one of token or tokenFile. You don’t need to add “Bearer” prefix string

server.remote.read.bearer.tokenFilestring
""

Token Auth file with Bearer token. You can use one of token or tokenFile

server.remote.read.urlstring
""

VMAlert remote read URL

server.remote.write.basicAuthobject
password: ""
username: ""

Basic auth for remote write

server.remote.write.bearerobject
token: ""
tokenFile: ""

Auth based on Bearer token for remote write

server.remote.write.bearer.tokenstring
""

Token with Bearer token. You can use one of token or tokenFile. You don’t need to add “Bearer” prefix string

server.remote.write.bearer.tokenFilestring
""

Token Auth file with Bearer token. You can use one of token or tokenFile

server.remote.write.urlstring
""

VMAlert remote write URL

server.replicaCountint
1

Replica count

server.resourcesobject
{}

Resource object. Details are here

server.securityContextobject
enabled: true

Security context to be added to server pods

server.service.annotationsobject
{}

Service annotations

server.service.clusterIPstring
""

Service ClusterIP

server.service.externalIPslist
[]

Service external IPs. Check here for details

server.service.externalTrafficPolicystring
""

Service external traffic policy. Check here for details

server.service.healthCheckNodePortstring
""

Health check node port for a service. Check here for details

server.service.ipFamilieslist
[]

List of service IP families. Check here for details.

server.service.ipFamilyPolicystring
""

Service IP family policy. Check here for details.

server.service.labelsobject
{}

Service labels

server.service.loadBalancerIPstring
""

Service load balancer IP

server.service.loadBalancerSourceRangeslist
[]

Load balancer source range

server.service.servicePortint
8880

Service port

server.service.typestring
ClusterIP

Service type

server.strategyobject
rollingUpdate:
    maxSurge: 25%
    maxUnavailable: 25%
type: RollingUpdate

Deployment strategy, set to standard k8s default

server.tolerationslist
[]

Node tolerations for server scheduling to nodes with taints. Details are here

server.verticalPodAutoscalerobject
enabled: false

Vertical Pod Autoscaler

server.verticalPodAutoscaler.enabledbool
false

Use VPA for vmalert

serviceAccount.annotationsobject
{}

Annotations to add to the service account

serviceAccount.automountTokenbool
true

Mount API token to pod directly

serviceAccount.createbool
true

Specifies whether a service account should be created

serviceAccount.namestring
null

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

serviceMonitor.annotationsobject
{}

Service Monitor annotations

serviceMonitor.basicAuthobject
{}

Basic auth params for Service Monitor

serviceMonitor.enabledbool
false

Enable deployment of Service Monitor for server component. This is Prometheus operator object

serviceMonitor.extraLabelsobject
{}

Service Monitor labels

serviceMonitor.metricRelabelingslist
[]

Service Monitor metricRelabelings

serviceMonitor.relabelingslist
[]

Service Monitor relabelings