victoria-metrics-alert

by apecloud

Helm chartv0.8.3-reloadApp v1.95.1Apache-2.0Verified publisher

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

About this chart

Helm Chart For Victoria Metrics Alert.

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.

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

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

helm show values vm/victoria-metrics-alert > values.yaml

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

Test the installation with command:

helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE --debug --dry-run

Install chart with command:

helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE

Get the pods lists by running this commands:

kubectl get pods -A | grep 'alert'

Get the application by running this command:

helm list -f vmalert -n NAMESPACE

See the history of versions of vmalert application with command.

helm history vmalert -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 vmalert -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""
alertmanager.baseURLPrefixstring""
alertmanager.config.global.resolve_timeoutstring"5m"
alertmanager.config.receivers[0].namestring"devnull"
alertmanager.config.route.group_by[0]string"alertname"
alertmanager.config.route.group_intervalstring"10s"
alertmanager.config.route.group_waitstring"30s"
alertmanager.config.route.receiverstring"devnull"
alertmanager.config.route.repeat_intervalstring"24h"
alertmanager.configMapstring""
alertmanager.enabledboolfalse
alertmanager.extraArgsobject{}
alertmanager.imagestring"prom/alertmanager"
alertmanager.imagePullSecretslist[]
alertmanager.ingress.annotationsobject{}
alertmanager.ingress.enabledboolfalse
alertmanager.ingress.extraLabelsobject{}
alertmanager.ingress.hostslist[]
alertmanager.ingress.pathTypestring"Prefix"pathType is only for k8s >= 1.1=
alertmanager.ingress.tlslist[]
alertmanager.nodeSelectorobject{}
alertmanager.persistentVolume.accessModeslist["ReadWriteOnce"]Array of access modes. Must match those of existing PV or dynamic provisioner. Ref: http://kubernetes.io/docs/user-guide/persistent-volumes/
alertmanager.persistentVolume.annotationsobject{}Persistant volume annotations
alertmanager.persistentVolume.enabledboolfalseCreate/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.storageClassstring""StorageClass to use for persistent volume. Requires alertmanager.persistentVolume.enabled: true. If defined, PVC created automatically
alertmanager.persistentVolume.subPathstring""Mount subpath
alertmanager.podMetadata.annotationsobject{}
alertmanager.podMetadata.labelsobject{}
alertmanager.podSecurityContextobject{}
alertmanager.priorityClassNamestring""
alertmanager.resourcesobject{}
alertmanager.retentionstring"120h"
alertmanager.service.annotationsobject{}
alertmanager.service.portint9093
alertmanager.service.typestring"ClusterIP"
alertmanager.tagstring"v0.25.0"
alertmanager.templatesobject{}
alertmanager.tolerationslist[]
extraObjectslist[]Add extra specs dynamically to this chart
licenseobject{"key":"","secret":{"key":"","name":""}}Enterprise license key configuration for VictoriaMetrics enterprise. Required only for VictoriaMetrics enterprise. Documentation - https://docs.victoriametrics.com/enterprise.html, for more information, visit https://victoriametrics.com/products/enterprise/ . To request a trial license, go to https://victoriametrics.com/products/enterprise/trial/ 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
rbac.annotationsobject{}
rbac.createbooltrue
rbac.extraLabelsobject{}
rbac.namespacedboolfalse
rbac.pspEnabledbooltrue
server.affinityobject{}
server.annotationsobject{}
server.config.alerts.groupslist[]
server.configMapstring""
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.datasource.urlstring""
server.enabledbooltrue
server.envlist[]Additional environment variables (ex.: secret tokens, flags) https://github.com/VictoriaMetrics/VictoriaMetrics#environment-variables
server.extraArgs."envflag.enable"string"true"
server.extraArgs."envflag.prefix"string"VM_"
server.extraArgs.loggerFormatstring"json"
server.extraContainerslist[]
server.extraHostPathMountslist[]
server.extraVolumeMountslist[]
server.extraVolumeslist[]
server.fullnameOverridestring""
server.image.pullPolicystring"IfNotPresent"
server.image.repositorystring"victoriametrics/vmalert"
server.image.tagstring""
server.imagePullSecretslist[]
server.ingress.annotationsobject{}
server.ingress.enabledboolfalse
server.ingress.extraLabelsobject{}
server.ingress.hostslist[]
server.ingress.pathTypestring"Prefix"pathType is only for k8s >= 1.1=
server.ingress.tlslist[]
server.labelsobject{}
server.minReadySecondsint0
server.namestring"server"
server.nameOverridestring""
server.nodeSelectorobject{}
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{}
server.podDisruptionBudget.enabledboolfalse
server.podDisruptionBudget.labelsobject{}
server.podLabelsobject{}
server.podSecurityContextobject{}
server.priorityClassNamestring""
server.probe.liveness.failureThresholdint3
server.probe.liveness.initialDelaySecondsint5
server.probe.liveness.periodSecondsint15
server.probe.liveness.timeoutSecondsint5
server.probe.readiness.failureThresholdint3
server.probe.readiness.initialDelaySecondsint5
server.probe.readiness.periodSecondsint15
server.probe.readiness.timeoutSecondsint5
server.remote.read.basicAuthobject{"password":"","username":""}Basic auth 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""
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""
server.replicaCountint1
server.resourcesobject{}
server.securityContextobject{}
server.service.annotationsobject{}
server.service.clusterIPstring""
server.service.externalIPslist[]
server.service.labelsobject{}
server.service.loadBalancerIPstring""
server.service.loadBalancerSourceRangeslist[]
server.service.servicePortint8880
server.service.typestring"ClusterIP"
server.strategy.rollingUpdate.maxSurgestring"25%"
server.strategy.rollingUpdate.maxUnavailablestring"25%"
server.strategy.typestring"RollingUpdate"
server.tolerationslist[]
serviceAccount.annotationsobject{}
serviceAccount.automountTokenbooltrue
serviceAccount.createbooltrue
serviceAccount.namestringnil
serviceMonitor.annotationsobject{}
serviceMonitor.enabledboolfalse
serviceMonitor.extraLabelsobject{}
serviceMonitor.relabelingslist[]

Deploy victoria-metrics-alert with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has victoria-metrics-alert on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartvictoria-metrics-alert is pinned at v0.8.3-reload in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply