added repo

This commit is contained in:
Your Name
2026-08-26 03:39:42 +05:30
parent 45c25a95af
commit b8575bb8b9
6889 changed files with 1217125 additions and 0 deletions
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
@@ -0,0 +1,5 @@
apiVersion: v2
name: victoria-metrics-alert
description: Victoria Metrics Alert - executes a list of given MetricsQL expressions (rules) and sends alerts to Alert Manager.
version: 0.6.4
appVersion: v1.126.0
@@ -0,0 +1,229 @@
# Helm Chart For Victoria Metrics Alert.
![Version: 0.6.3](https://img.shields.io/badge/Version-0.6.3-informational?style=flat-square)
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](../../REQUIREMENTS.md).
# How to install
Access a Kubernetes cluster.
Add a chart helm repository with follow commands:
```console
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
```
List versions of ``vm/victoria-metrics-alert`` chart available to installation:
##### for helm v3
```console
helm search repo vm/victoria-metrics-alert -l
```
Export default values of ``victoria-metrics-alert`` chart to file ``values.yaml``:
```console
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:
```console
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE --debug --dry-run
```
Install chart with command:
##### for helm v3
```console
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE
```
Get the pods lists by running this commands:
```console
kubectl get pods -A | grep 'alert'
```
Get the application by running this command:
```console
helm list -f vmalert -n NAMESPACE
```
See the history of versions of ``vmalert`` application with command.
```console
helm history vmalert -n NAMESPACE
```
## HA configuration for Alertmanager
There is no option on this chart to set up Alertmanager with [HA mode](https://github.com/prometheus/alertmanager#high-availability).
To enable the HA configuration, you can use:
- [VictoriaMetrics Operator](https://docs.victoriametrics.com/operator/VictoriaMetrics-Operator.html)
- official [Alertmanager Helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/alertmanager)
# How to uninstall
Remove application with command.
```console
helm uninstall vmalert -n NAMESPACE
```
# Documentation of Helm Chart
Install ``helm-docs`` following the instructions on this [tutorial](../../REQUIREMENTS.md).
Generate docs with ``helm-docs`` command.
```bash
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.
| Key | Type | Default | Description |
|-----|------|---------|-------------|
| alertmanager.baseURL | string | `""` | |
| alertmanager.baseURLPrefix | string | `""` | |
| alertmanager.config.global.resolve_timeout | string | `"5m"` | |
| alertmanager.config.receivers[0].name | string | `"devnull"` | |
| alertmanager.config.route.group_by[0] | string | `"alertname"` | |
| alertmanager.config.route.group_interval | string | `"10s"` | |
| alertmanager.config.route.group_wait | string | `"30s"` | |
| alertmanager.config.route.receiver | string | `"devnull"` | |
| alertmanager.config.route.repeat_interval | string | `"24h"` | |
| alertmanager.configMap | string | `""` | |
| alertmanager.enabled | bool | `false` | |
| alertmanager.extraArgs | object | `{}` | |
| alertmanager.image | string | `"prom/alertmanager"` | |
| alertmanager.imagePullSecrets | list | `[]` | |
| alertmanager.ingress.annotations | object | `{}` | |
| alertmanager.ingress.enabled | bool | `false` | |
| alertmanager.ingress.extraLabels | object | `{}` | |
| alertmanager.ingress.hosts | list | `[]` | |
| alertmanager.ingress.pathType | string | `"Prefix"` | pathType is only for k8s >= 1.1= |
| alertmanager.ingress.tls | list | `[]` | |
| alertmanager.nodeSelector | object | `{}` | |
| alertmanager.persistentVolume.accessModes | list | `["ReadWriteOnce"]` | Array of access modes. Must match those of existing PV or dynamic provisioner. Ref: [http://kubernetes.io/docs/user-guide/persistent-volumes/](http://kubernetes.io/docs/user-guide/persistent-volumes/) |
| alertmanager.persistentVolume.annotations | object | `{}` | Persistant volume annotations |
| alertmanager.persistentVolume.enabled | bool | `false` | Create/use Persistent Volume Claim for alertmanager component. Empty dir if false |
| alertmanager.persistentVolume.existingClaim | string | `""` | Existing Claim name. If defined, PVC must be created manually before volume will be bound |
| alertmanager.persistentVolume.mountPath | string | `"/data"` | Mount path. Alertmanager data Persistent Volume mount root path. |
| alertmanager.persistentVolume.size | string | `"50Mi"` | Size of the volume. Better to set the same as resource limit memory property. |
| alertmanager.persistentVolume.storageClass | string | `""` | StorageClass to use for persistent volume. Requires alertmanager.persistentVolume.enabled: true. If defined, PVC created automatically |
| alertmanager.persistentVolume.subPath | string | `""` | Mount subpath |
| alertmanager.podMetadata.annotations | object | `{}` | |
| alertmanager.podMetadata.labels | object | `{}` | |
| alertmanager.podSecurityContext | object | `{}` | |
| alertmanager.priorityClassName | string | `""` | |
| alertmanager.resources | object | `{}` | |
| alertmanager.retention | string | `"120h"` | |
| alertmanager.service.annotations | object | `{}` | |
| alertmanager.service.port | int | `9093` | |
| alertmanager.service.type | string | `"ClusterIP"` | |
| alertmanager.tag | string | `"v0.25.0"` | |
| alertmanager.templates | object | `{}` | |
| alertmanager.tolerations | list | `[]` | |
| imagePullSecrets | list | `[]` | |
| rbac.annotations | object | `{}` | |
| rbac.create | bool | `true` | |
| rbac.extraLabels | object | `{}` | |
| rbac.namespaced | bool | `false` | |
| rbac.pspEnabled | bool | `true` | |
| server.affinity | object | `{}` | |
| server.annotations | object | `{}` | |
| server.config.alerts.groups | list | `[]` | |
| server.configMap | string | `""` | |
| server.datasource.basicAuth | object | `{"password":"","username":""}` | Basic auth for datasource |
| server.datasource.bearer.token | string | `""` | Token with Bearer token. You can use one of token or tokenFile. You don't need to add "Bearer" prefix string |
| server.datasource.bearer.tokenFile | string | `""` | Token Auth file with Bearer token. You can use one of token or tokenFile |
| server.datasource.url | string | `""` | |
| server.enabled | bool | `true` | |
| server.env | list | `[]` | 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.loggerFormat | string | `"json"` | |
| server.extraContainers | list | `[]` | |
| server.extraHostPathMounts | list | `[]` | |
| server.extraVolumeMounts | list | `[]` | |
| server.extraVolumes | list | `[]` | |
| server.fullnameOverride | string | `""` | |
| server.image.pullPolicy | string | `"IfNotPresent"` | |
| server.image.repository | string | `"victoriametrics/vmalert"` | |
| server.image.tag | string | `""` | |
| server.ingress.annotations | object | `{}` | |
| server.ingress.enabled | bool | `false` | |
| server.ingress.extraLabels | object | `{}` | |
| server.ingress.hosts | list | `[]` | |
| server.ingress.pathType | string | `"Prefix"` | pathType is only for k8s >= 1.1= |
| server.ingress.tls | list | `[]` | |
| server.labels | object | `{}` | |
| server.minReadySeconds | int | `0` | |
| server.name | string | `"server"` | |
| server.nameOverride | string | `""` | |
| server.nodeSelector | object | `{}` | |
| server.notifier | object | `{"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.basicAuth | object | `{"password":"","username":""}` | Basic auth for alertmanager |
| server.notifier.alertmanager.bearer.token | string | `""` | 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.tokenFile | string | `""` | Token Auth file with Bearer token. You can use one of token or tokenFile |
| server.notifiers | list | `[]` | Additional notifiers to use for alerts |
| server.podAnnotations | object | `{}` | |
| server.podDisruptionBudget.enabled | bool | `false` | |
| server.podDisruptionBudget.labels | object | `{}` | |
| server.podLabels | object | `{}` | |
| server.podSecurityContext | object | `{}` | |
| server.priorityClassName | string | `""` | |
| server.remote.read.basicAuth | object | `{"password":"","username":""}` | Basic auth for remote read |
| server.remote.read.bearer.token | string | `""` | 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.tokenFile | string | `""` | Token Auth file with Bearer token. You can use one of token or tokenFile |
| server.remote.read.url | string | `""` | |
| server.remote.write.basicAuth | object | `{"password":"","username":""}` | Basic auth for remote write |
| server.remote.write.bearer | object | `{"token":"","tokenFile":""}` | Auth based on Bearer token for remote write |
| server.remote.write.bearer.token | string | `""` | 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.tokenFile | string | `""` | Token Auth file with Bearer token. You can use one of token or tokenFile |
| server.remote.write.url | string | `""` | |
| server.replicaCount | int | `1` | |
| server.resources | object | `{}` | |
| server.securityContext | object | `{}` | |
| server.service.annotations | object | `{}` | |
| server.service.clusterIP | string | `""` | |
| server.service.externalIPs | list | `[]` | |
| server.service.labels | object | `{}` | |
| server.service.loadBalancerIP | string | `""` | |
| server.service.loadBalancerSourceRanges | list | `[]` | |
| server.service.servicePort | int | `8880` | |
| server.service.type | string | `"ClusterIP"` | |
| server.strategy.rollingUpdate.maxSurge | string | `"25%"` | |
| server.strategy.rollingUpdate.maxUnavailable | string | `"25%"` | |
| server.strategy.type | string | `"RollingUpdate"` | |
| server.tolerations | list | `[]` | |
| serviceAccount.annotations | object | `{}` | |
| serviceAccount.automountToken | bool | `true` | |
| serviceAccount.create | bool | `true` | |
| serviceAccount.name | string | `nil` | |
| serviceMonitor.annotations | object | `{}` | |
| serviceMonitor.enabled | bool | `false` | |
| serviceMonitor.extraLabels | object | `{}` | |
| serviceMonitor.relabelings | list | `[]` | |
@@ -0,0 +1,106 @@
# Helm Chart For Victoria Metrics Alert.
{{ template "chart.typeBadge" . }} {{ template "chart.versionBadge" . }}
{{ template "chart.description" . }}
# Prerequisites
* Install the follow packages: ``git``, ``kubectl``, ``helm``, ``helm-docs``. See this [tutorial](../../REQUIREMENTS.md).
# How to install
Access a Kubernetes cluster.
Add a chart helm repository with follow commands:
```console
helm repo add vm https://victoriametrics.github.io/helm-charts/
helm repo update
```
List versions of ``vm/victoria-metrics-alert`` chart available to installation:
##### for helm v3
```console
helm search repo vm/victoria-metrics-alert -l
```
Export default values of ``victoria-metrics-alert`` chart to file ``values.yaml``:
```console
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:
```console
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE --debug --dry-run
```
Install chart with command:
##### for helm v3
```console
helm install vmalert vm/victoria-metrics-alert -f values.yaml -n NAMESPACE
```
Get the pods lists by running this commands:
```console
kubectl get pods -A | grep 'alert'
```
Get the application by running this command:
```console
helm list -f vmalert -n NAMESPACE
```
See the history of versions of ``vmalert`` application with command.
```console
helm history vmalert -n NAMESPACE
```
## HA configuration for Alertmanager
There is no option on this chart to set up Alertmanager with [HA mode](https://github.com/prometheus/alertmanager#high-availability).
To enable the HA configuration, you can use:
- [VictoriaMetrics Operator](https://docs.victoriametrics.com/operator/VictoriaMetrics-Operator.html)
- official [Alertmanager Helm chart](https://github.com/prometheus-community/helm-charts/tree/main/charts/alertmanager)
# How to uninstall
Remove application with command.
```console
helm uninstall vmalert -n NAMESPACE
```
# Documentation of Helm Chart
Install ``helm-docs`` following the instructions on this [tutorial](../../REQUIREMENTS.md).
Generate docs with ``helm-docs`` command.
```bash
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.
{{ template "chart.valuesTable" . }}
@@ -0,0 +1,388 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "vmalert.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Maintainer - Akshay Gupta
Tolerations and nodeSelector via Resources Requests.
*/}}
{{- define "meesho.server.getCpu" -}}
{{- $cpu := toString .Values.server.resources.requests.cpu -}}
{{- if contains "m" $cpu -}}
{{- $cpu := trimAll "m" $cpu | float64 -}}
{{- $cpu := $cpu | float64 -}}
{{- printf "%f" $cpu -}}
{{- else -}}
{{- $cpu := mulf $cpu 1000.000 -}}
{{- printf "%f" $cpu -}}
{{- end -}}
{{- end -}}
{{- define "meesho.server.getMem" -}}
{{- $mem := toString .Values.server.resources.requests.memory -}}
{{- if contains "Mi" $mem -}}
{{- $mem := trimAll "Mi" $mem | float64 -}}
{{- printf "%f" $mem -}}
{{- else if contains "Gi" $mem -}}
{{- $mem := trimAll "Gi" $mem | float64 -}}
{{- $mem := mulf $mem 1024.000 -}}
{{- printf "%f" $mem -}}
{{- end -}}
{{- end -}}
{{- define "meesho.server.getRatio" -}}
{{- $cpu := (include "meesho.server.getCpu" .) -}}
{{- $mem := (include "meesho.server.getMem" .) -}}
{{- $ratio := divf $mem $cpu -}}
{{- if gt $ratio 4.00 -}}
{{- printf "1to8" -}}
{{- else if gt $ratio 2.00 -}}
{{- printf "1to4" -}}
{{- else -}}
{{- printf "1to2" -}}
{{- end -}}
{{- end -}}
{{- define "meesho.server.dedicatedValue" -}}
{{- if (index .Values.server.labels "arch") -}}
{{- if (index .Values.server.labels "runpod") -}}
{{- $cpu := (include "meesho.server.getCpu" .) -}}
{{- $mem := (include "meesho.server.getMem" .) -}}
{{- $ratio := (include "meesho.server.getRatio" .) -}}
{{- $arch := .Values.server.labels.arch -}}
{{- $runPod := .Values.server.labels.runpod -}}
{{- printf "%s-%s-%s" $ratio $arch $runPod -}}
{{- else -}}
{{- printf "missing-runpod-label" -}}
{{- end -}}
{{- else -}}
{{- printf "missing-arch-label" -}}
{{- end -}}
{{/*- printf "%s-%s-%s-%s-%s" $ratio $arch $runPod $cpu $mem -*/}}
{{- end -}}
{{/*
Maintainer - Akshay Gupta
Tolerations and nodeSelector via Resources Requests.
*/}}
{{- define "meesho.alertmanager.getCpu" -}}
{{- $cpu := toString .Values.alertmanager.resources.requests.cpu -}}
{{- if contains "m" $cpu -}}
{{- $cpu := trimAll "m" $cpu | float64 -}}
{{- $cpu := $cpu | float64 -}}
{{- printf "%f" $cpu -}}
{{- else -}}
{{- $cpu := mulf $cpu 1000.000 -}}
{{- printf "%f" $cpu -}}
{{- end -}}
{{- end -}}
{{- define "meesho.alertmanager.getMem" -}}
{{- $mem := toString .Values.alertmanager.resources.requests.memory -}}
{{- if contains "Mi" $mem -}}
{{- $mem := trimAll "Mi" $mem | float64 -}}
{{- printf "%f" $mem -}}
{{- else if contains "Gi" $mem -}}
{{- $mem := trimAll "Gi" $mem | float64 -}}
{{- $mem := mulf $mem 1024.000 -}}
{{- printf "%f" $mem -}}
{{- end -}}
{{- end -}}
{{- define "meesho.alertmanager.getRatio" -}}
{{- $cpu := (include "meesho.alertmanager.getCpu" .) -}}
{{- $mem := (include "meesho.alertmanager.getMem" .) -}}
{{- $ratio := divf $mem $cpu -}}
{{- if gt $ratio 4.00 -}}
{{- printf "1to8" -}}
{{- else if gt $ratio 2.00 -}}
{{- printf "1to4" -}}
{{- else -}}
{{- printf "1to2" -}}
{{- end -}}
{{- end -}}
{{- define "meesho.alertmanager.dedicatedValue" -}}
{{- if (index .Values.alertmanager.labels "arch") -}}
{{- if (index .Values.alertmanager.labels "runpod") -}}
{{- $cpu := (include "meesho.alertmanager.getCpu" .) -}}
{{- $mem := (include "meesho.alertmanager.getMem" .) -}}
{{- $ratio := (include "meesho.alertmanager.getRatio" .) -}}
{{- $arch := .Values.alertmanager.labels.arch -}}
{{- $runPod := .Values.alertmanager.labels.runpod -}}
{{- printf "%s-%s-%s" $ratio $arch $runPod -}}
{{- else -}}
{{- printf "missing-runpod-label" -}}
{{- end -}}
{{- else -}}
{{- printf "missing-arch-label" -}}
{{- end -}}
{{/*- printf "%s-%s-%s-%s-%s" $ratio $arch $runPod $cpu $mem -*/}}
{{- end -}}
{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "vmalert.fullname" -}}
{{- if .Values.fullnameOverride -}}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "vmalert.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create unified labels for vmalert components
*/}}
{{- define "vmalert.common.matchLabels" -}}
app.kubernetes.io/name: {{ include "vmalert.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end -}}
{{- define "vmalert.common.metaLabels" -}}
helm.sh/chart: {{ include "vmalert.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end -}}
{{- define "vmalert.server.labels" -}}
{{- toYaml .Values.server.labels | nindent 0 }}
{{ include "vmalert.server.matchLabels" . }}
{{ include "vmalert.common.metaLabels" . }}
{{- end -}}
{{- define "vmalert.server.matchLabels" -}}
app: {{ .Values.server.name }}
{{ include "vmalert.common.matchLabels" . }}
{{- end -}}
{{/*
Create a fully qualified server name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "vmalert.server.fullname" -}}
{{- if .Values.server.fullnameOverride -}}
{{- .Values.server.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.server.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.server.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "vmalert.server.configname" -}}
{{- if .Values.server.configMap -}}
{{- .Values.server.configMap -}}
{{- else -}}
{{- include "vmalert.server.fullname" . -}}-alert-rules-config
{{- end -}}
{{- end -}}
{{/*
Create the name of the service account to use
*/}}
{{- define "vmalert.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "vmalert.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{- define "vmalert.alertmanager.labels" -}}
{{- toYaml .Values.alertmanager.labels | nindent 0 }}
{{ include "vmalert.alertmanager.matchLabels" . }}
{{ include "vmalert.common.metaLabels" . }}
{{- end -}}
{{- define "vmalert.alertmanager.matchLabels" -}}
app: alertmanager
{{ include "vmalert.common.matchLabels" . }}
{{- end -}}
{{/*
Create a fully qualified server name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
*/}}
{{- define "vmalert.alertmanager.fullname" -}}
{{- if .Values.alertmanager.fullnameOverride -}}
{{- .Values.alertmanager.fullnameOverride | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- $name := default .Chart.Name .Values.nameOverride -}}
{{- if contains $name .Release.Name -}}
{{- printf "%s-%s" .Release.Name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
{{- else -}}
{{- printf "%s-%s-%s" .Release.Name $name .Values.alertmanager.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- define "vmalert.alertmanager.configname" -}}
{{- if .Values.alertmanager.configMap -}}
{{- .Values.alertmanager.configMap -}}
{{- else -}}
{{- include "vmalert.alertmanager.fullname" . -}}-alertmanager-config
{{- end -}}
{{- end -}}
{{- define "vmalert.alertmanager.url" -}}
{{- if .Values.alertmanager.enabled -}}
http://{{- include "vmalert.alertmanager.fullname" . -}}:9093
{{- else -}}
{{- .Values.server.notifier.alertmanager.url -}}
{{- end -}}
{{- end -}}
{{- define "vmalert.alertmanager.urls" -}}
{{- $urls := list -}}
{{- with (include "vmalert.alertmanager.url" .) -}}
{{- $urls = append $urls . -}}
{{- end -}}
{{- range .Values.server.notifiers }}
{{- if not (eq .alertmanager.url "") -}}
{{- $urls = append $urls .alertmanager.url -}}
{{- end -}}
{{- end -}}
{{- join "," $urls }}
{{- end -}}
{{- define "vmalert.alertmanager.passwords" -}}
{{- $password := list -}}
{{- if .Values.alertmanager.enabled -}}
{{- $password = append $password "" -}}
{{- end -}}
{{- $notifiers := append .Values.server.notifiers .Values.server.notifier }}
{{- range $notifiers }}
{{- if not (eq .alertmanager.url "") -}}
{{- if and .alertmanager.basicAuth .alertmanager.basicAuth.password -}}
{{- $password = append $password .alertmanager.basicAuth.password -}}
{{- else -}}
{{- $password = append $password "" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ include "_vmalert.optionalPrintList" $password }}
{{- end -}}
{{- define "vmalert.alertmanager.usernames" -}}
{{- $usernames := list -}}
{{- if .Values.alertmanager.enabled -}}
{{- $usernames = append $usernames "" -}}
{{- end -}}
{{- $notifiers := append .Values.server.notifiers .Values.server.notifier }}
{{- range $notifiers }}
{{- if not (eq .alertmanager.url "") -}}
{{- if and .alertmanager.basicAuth .alertmanager.basicAuth.username -}}
{{- $usernames = append $usernames .alertmanager.basicAuth.username -}}
{{- else -}}
{{- $usernames = append $usernames "" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ include "_vmalert.optionalPrintList" $usernames }}
{{- end -}}
{{- define "vmalert.alertmanager.bearerTokens" -}}
{{- $tokens := list -}}
{{- if .Values.alertmanager.enabled -}}
{{- $tokens = append $tokens "" -}}
{{- end -}}
{{- $notifiers := append .Values.server.notifiers .Values.server.notifier }}
{{- range $notifiers }}
{{- if not (eq .alertmanager.url "") -}}
{{- if and .alertmanager.bearer .alertmanager.bearer.token -}}
{{- $tokens = append $tokens .alertmanager.bearer.token -}}
{{- else -}}
{{- $tokens = append $tokens "" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ include "_vmalert.optionalPrintList" $tokens }}
{{- end -}}
{{- define "vmalert.alertmanager.bearerTokenFiles" -}}
{{- $files := list -}}
{{- if .Values.alertmanager.enabled -}}
{{- $files = append $files "" -}}
{{- end -}}
{{- $notifiers := append .Values.server.notifiers .Values.server.notifier }}
{{- range $notifiers }}
{{- if not (eq .alertmanager.url "") -}}
{{- if and .alertmanager.bearer .alertmanager.bearer.tokenFile -}}
{{- $files = append $files .alertmanager.bearer.tokenFile -}}
{{- else -}}
{{- $files = append $files "" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{ include "_vmalert.optionalPrintList" $files }}
{{- end -}}
{{- define "_vmalert.optionalPrintList" }}
{{- $str := join "," . -}}
{{- $cleared := $str | replace "," "" | trim -}}
{{- if eq $cleared "" -}}
{{ $cleared }}
{{- else -}}
{{ $str }}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "vmalert.ingress.apiVersion" -}}
{{- if and (.Capabilities.APIVersions.Has "networking.k8s.io/v1") -}}
{{- print "networking.k8s.io/v1" -}}
{{- else if .Capabilities.APIVersions.Has "networking.k8s.io/v1beta1" -}}
{{- print "networking.k8s.io/v1beta1" -}}
{{- else -}}
{{- print "extensions/v1beta1" -}}
{{- end -}}
{{- end -}}
{{/*
Return if ingress is stable.
*/}}
{{- define "vmalert.ingress.isStable" -}}
{{- eq (include "vmalert.ingress.apiVersion" .) "networking.k8s.io/v1" -}}
{{- end -}}
{{/*
Return if ingress supports ingressClassName.
*/}}
{{- define "vmalert.ingress.supportsIngressClassName" -}}
{{- or (eq (include "vmalert.ingress.isStable" .) "true") (and (eq (include "vmalert.ingress.apiVersion" .) "networking.k8s.io/v1beta1")) -}}
{{- end -}}
{{/*
Return if ingress supports pathType.
*/}}
{{- define "vmalert.ingress.supportsPathType" -}}
{{- or (eq (include "vmalert.ingress.isStable" .) "true") (and (eq (include "vmalert.ingress.apiVersion" .) "networking.k8s.io/v1beta1")) -}}
{{- end -}}
@@ -0,0 +1,16 @@
{{- if and .Values.alertmanager.enabled (eq .Values.alertmanager.configMap "") }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vmalert.alertmanager.configname" .}}
namespace: {{.Release.Namespace}}
labels: {{- include "vmalert.alertmanager.labels" . | nindent 4}}
data:
alertmanager.yaml: |
{{ toYaml .Values.alertmanager.config | nindent 4 }}
{{- range $key, $value := .Values.alertmanager.templates }}
{{ $key }}: |-
{{- $value | nindent 4 }}
{{- end }}
{{- end }}
@@ -0,0 +1,143 @@
{{- if .Values.alertmanager.enabled -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vmalert.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.alertmanager.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "vmalert.alertmanager.matchLabels" . | nindent 6 }}
{{- if .Values.alertmanager.persistentVolume.enabled }}
strategy:
# Must be "Recreate" when we have a persistent volume
type: Recreate
{{- end }}
template:
metadata:
labels:
{{- include "vmalert.alertmanager.labels" . | nindent 8 }}
{{- range $key, $value := .Values.alertmanager.podMetadata.labels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/alertmanager-configmap.yaml") . | sha256sum }}
{{- range $key, $value := .Values.alertmanager.podMetadata.annotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- with .Values.alertmanager.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "vmalert.serviceAccountName" . }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- with .Values.alertmanager.securityContext }}
securityContext:
{{- toYaml .| nindent 8 }}
{{- end }}
containers:
- name: {{ template "vmalert.name" . }}-alertmanager
securityContext:
{{- toYaml .Values.alertmanager.podSecurityContext | nindent 12 }}
image: "{{ .Values.alertmanager.image }}:{{ .Values.alertmanager.tag }}"
args:
- --config.file=/config/alertmanager.yaml
{{ if .Values.alertmanager.persistentVolume.enabled }}
- {{ printf "%s=%s" "--storage.path" .Values.alertmanager.persistentVolume.mountPath | quote}}
{{- else}}
- --storage.path=/data
{{- end}}
- --data.retention={{ .Values.alertmanager.retention }}
- --web.listen-address=0.0.0.0:9093
- --cluster.advertise-address=$(POD_IP):6783
{{ if .Values.alertmanager.baseURL }}
- --web.external-url={{ .Values.alertmanager.baseURL }}
{{- end }}
{{ if .Values.alertmanager.baseURLPrefix }}
- --web.route-prefix={{ .Values.alertmanager.baseURLPrefix }}
{{- end }}
{{- range $key, $value := .Values.alertmanager.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
ports:
- name: web
containerPort: 9093
env:
- name: POD_IP
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: status.podIP
readinessProbe:
httpGet:
{{ if .Values.alertmanager.baseURLPrefix }}
path: {{ .Values.alertmanager.baseURLPrefix }}/-/ready
{{- else}}
path: /-/ready
{{- end }}
port: web
livenessProbe:
httpGet:
{{ if .Values.alertmanager.baseURLPrefix }}
path: {{ .Values.alertmanager.baseURLPrefix }}/-/healthy
{{- else}}
path: /-/healthy
{{- end }}
port: web
volumeMounts:
- name: storage
{{- if .Values.alertmanager.persistentVolume.enabled }}
mountPath: {{ .Values.alertmanager.persistentVolume.mountPath }}
{{- else }}
mountPath: /data
{{- end }}
- name: config
mountPath: /config
readOnly: true
resources:
{{- toYaml .Values.alertmanager.resources | nindent 12 }}
{{- if .Values.alertmanager.priorityClassName }}
priorityClassName: {{ .Values.alertmanager.priorityClassName | quote }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
nodeSelector:
{{- if .Values.dedicatedValue }}
dedicated: {{ include "meesho.alertmanager.dedicatedValue" . }}
{{- else }}
{{- with .Values.alertmanager.nodeSelector }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
tolerations:
{{- if .Values.dedicatedValue }}
- key: "dedicated"
operator: "Equal"
value: {{ include "meesho.alertmanager.dedicatedValue" . }}
effect: "NoSchedule"
{{- else }}
{{- with .Values.alertmanager.tolerations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: storage
{{- if .Values.alertmanager.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.alertmanager.persistentVolume.existingClaim }}{{ .Values.alertmanager.persistentVolume.existingClaim }}{{- else }}{{ include "vmalert.alertmanager.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
- name: config
configMap:
name: {{ include "vmalert.alertmanager.configname" . }}
{{- end -}}
@@ -0,0 +1,50 @@
{{- if and .Values.alertmanager.enabled .Values.alertmanager.ingress.enabled }}
{{- $ingressApiIsStable := eq (include "vmalert.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "vmalert.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "vmalert.ingress.supportsPathType" .) "true" -}}
{{- $servicePort := .Values.alertmanager.service.port -}}
{{- $ingressPathType := .Values.alertmanager.ingress.pathType -}}
apiVersion: {{ include "vmalert.ingress.apiVersion" . }}
kind: Ingress
metadata:
{{- with .Values.alertmanager.ingress.annotations }}
annotations:
{{ toYaml .| indent 4 }}
{{- end }}
labels:
{{- include "vmalert.alertmanager.labels" . | nindent 4 }}
{{ with .Values.alertmanager.ingress.extraLabels }}
{{ toYaml . | indent 4 }}
{{ end }}
name: {{ template "vmalert.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.alertmanager.ingress.ingressClassName }}
ingressClassName: {{ .Values.alertmanager.ingress.ingressClassName }}
{{- end }}
rules:
{{- $serviceName := include "vmalert.alertmanager.fullname" . }}
{{- range .Values.alertmanager.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ .path }}
{{- if $ingressSupportsPathType }}
pathType: {{ $ingressPathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- else }}
serviceName: {{ $serviceName }}
servicePort: {{ .port | default "http"}}
{{- end }}
{{- end -}}
{{- if .Values.alertmanager.ingress.tls }}
tls:
{{ toYaml .Values.alertmanager.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,26 @@
{{- if .Values.alertmanager.enabled -}}
{{- if and .Values.alertmanager.persistentVolume.enabled (not .Values.alertmanager.persistentVolume.existingClaim)}}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ include "vmalert.alertmanager.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.alertmanager.labels" . | nindent 4 }}
{{- with .Values.alertmanager.persistentVolume.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- range .Values.alertmanager.persistentVolume.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.alertmanager.persistentVolume.size | quote }}
{{- if .Values.alertmanager.persistentVolume.storageClass }}
storageClassName: {{ .Values.alertmanager.persistentVolume.storageClass }}
{{- end -}}
{{- end -}}
{{- end -}}
@@ -0,0 +1,21 @@
{{- if .Values.alertmanager.enabled -}}
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
{{- with .Values.alertmanager.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "vmalert.alertmanager.labels" . | nindent 4 }}
name: {{ template "vmalert.alertmanager.fullname" . }}
spec:
ports:
- name: web
port: 9093
targetPort: web
protocol: TCP
selector:
{{- include "vmalert.alertmanager.matchLabels" . | nindent 4 }}
{{- end }}
@@ -0,0 +1,24 @@
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "vmalert.server.fullname" . }}-clusterrolebinding
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{ toYaml . | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ include "vmalert.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "vmalert.server.fullname" . }}-clusterrole
apiGroup: rbac.authorization.k8s.io
{{- end -}}
@@ -0,0 +1,42 @@
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "vmalert.server.fullname" . }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{ toYaml . | indent 4}}
{{- end }}
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
{{- with .Values.rbac.annotations }}
{{ toYaml . | indent 4}}
{{- end }}
spec:
privileged: false
allowPrivilegeEscalation: false
requiredDropCapabilities:
# Default set from Docker, with DAC_OVERRIDE and CHOWN
- ALL
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'persistentVolumeClaim'
hostNetwork: false
hostIPC: false
hostPID: false
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
{{- end }}
@@ -0,0 +1,25 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "vmalert.server.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{ toYaml . | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [{{ template "vmalert.server.fullname" . }}]
{{- else }}
rules: []
{{- end }}
{{- end }}
@@ -0,0 +1,24 @@
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "vmalert.server.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.rbac.extraLabels }}
{{ toYaml . | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "vmalert.server.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ include "vmalert.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end -}}
@@ -0,0 +1,25 @@
{{- if and .Values.server.enabled .Values.server.persistentVolume.enabled (not .Values.server.persistentVolume.existingClaim) }}
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ .Values.server.persistentVolume.name | default (printf "%s-alert-rules-pvc" (include "vmalert.server.fullname" .)) }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.server.persistentVolume.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
accessModes:
{{- range .Values.server.persistentVolume.accessModes }}
- {{ . | quote }}
{{- end }}
resources:
requests:
storage: {{ .Values.server.persistentVolume.size | quote }}
{{- if .Values.server.persistentVolume.storageClassName }}
storageClassName: {{ .Values.server.persistentVolume.storageClassName }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,11 @@
{{- if eq .Values.server.configMap "" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "vmalert.server.configname" . }}
namespace: {{ .Release.Namespace }}
labels: {{- include "vmalert.server.labels" . | nindent 4 }}
data:
alert-rules.yaml: |
{{ toYaml .Values.server.config.alerts | nindent 4 }}
{{- end }}
@@ -0,0 +1,215 @@
{{- if and .Values.server.enabled -}}
{{- if not .Values.server.extraArgs.rule }}
{{- if and (eq .Values.server.configMap "") (eq (len .Values.server.config.alerts.groups) 0) -}}
{{- fail "at least one item in `.server.config.alerts.groups` or `.server.extraArgs.rule` must be set " -}}
{{- end -}}
{{- end -}}
{{- if (eq (include "vmalert.alertmanager.urls" . ) "") -}}
{{- fail "alert manager URL must be specified. Please fill server.notifier.alertmanager.url or server.notifiers or enable Alertmanager in values file" -}}
{{- end -}}
{{- if eq .Values.server.datasource.url "" -}}
{{- fail "server.datasource.url datasource URL must be specified" -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vmalert.server.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.server.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
minReadySeconds: {{ .Values.server.minReadySeconds }}
replicas: {{ .Values.server.replicaCount }}
selector:
matchLabels:
{{- include "vmalert.server.matchLabels" . | nindent 6 }}
{{- with .Values.server.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
template:
metadata:
labels:
{{- include "vmalert.server.labels" . | nindent 8 }}
{{- range $key, $value := .Values.server.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
annotations:
checksum/config: {{ include (print $.Template.BasePath "/server-alerts-configmap.yaml") . | sha256sum }}
{{- range $key, $value := .Values.server.podAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.topologySpreadConstraints }}
topologySpreadConstraints:
{{ toYaml .Values.topologySpreadConstraints | indent 8 }}
{{- end }}
{{- with .Values.server.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "vmalert.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.server.securityContext | nindent 8 }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
containers:
- name: {{ template "vmalert.name" . }}-{{ .Values.server.name }}
securityContext:
{{- toYaml .Values.server.podSecurityContext | nindent 12 }}
image: "{{ .Values.server.image.repository }}:{{ default .Chart.AppVersion .Values.server.image.tag }}"
args:
- -rule=/config/alert-rules.yaml
- -datasource.url={{ .Values.server.datasource.url}}
{{- if or .Values.server.datasource.basicAuth.password .Values.server.datasource.basicAuth.username }}
- -datasource.basicAuth.password={{ .Values.server.datasource.basicAuth.password}}
- -datasource.basicAuth.username={{ .Values.server.datasource.basicAuth.username}}
{{- end }}
{{- with .Values.server.datasource.bearer.token }}
- -datasource.bearerToken={{ . }}
{{- end }}
{{- with .Values.server.datasource.bearer.tokenFile }}
- -datasource.bearerTokenFile={{ . }}
{{- end }}
- -notifier.url={{ include "vmalert.alertmanager.urls" . }}
{{- with (include "vmalert.alertmanager.passwords" .) }}
- -notifier.basicAuth.password={{ . }}
{{- end }}
{{- with (include "vmalert.alertmanager.usernames" .) }}
- -notifier.basicAuth.username={{ . }}
{{- end }}
{{- with (include "vmalert.alertmanager.bearerTokens" .) }}
- -notifier.bearerToken={{ . }}
{{- end }}
{{- with (include "vmalert.alertmanager.bearerTokenFiles" .) }}
- -notifier.bearerTokenFile={{ . }}
{{- end }}
- -remoteRead.url={{ .Values.server.remote.read.url }}
{{- if or .Values.server.remote.read.basicAuth.password .Values.server.remote.read.basicAuth.username }}
- -remoteRead.basicAuth.password={{ .Values.server.remote.read.basicAuth.password }}
- -remoteRead.basicAuth.username={{ .Values.server.remote.read.basicAuth.username }}
{{- end }}
{{- with .Values.server.remote.read.bearer.token }}
- -remoteRead.bearerToken={{ . }}
{{- end }}
{{- with .Values.server.remote.read.bearer.tokenFile }}
- -remoteRead.bearerTokenFile={{ . }}
{{- end }}
- -remoteWrite.url={{ .Values.server.remote.write.url }}
{{- if or .Values.server.remote.write.basicAuth.password .Values.server.remote.write.basicAuth.username }}
- -remoteWrite.basicAuth.password={{ .Values.server.remote.write.basicAuth.password }}
- -remoteWrite.basicAuth.username={{ .Values.server.remote.write.basicAuth.username }}
{{- end }}
{{- with .Values.server.remote.write.bearer.token }}
- -remoteWrite.bearerToken={{ . }}
{{- end }}
{{- with .Values.server.remote.write.bearer.tokenFile }}
- -remoteWrite.bearerTokenFile={{ . }}
{{- end }}
{{- range $key, $value := .Values.server.extraArgs }}
{{- if eq $key "rule" }}
- -{{ $key }}={{ $value | quote}}
{{- else }}
- -{{ $key }}={{ $value }}
{{- end }}
{{- end }}
imagePullPolicy: {{ .Values.server.image.pullPolicy }}
env:
- name: TZ
value: Asia/Kolkata
{{- with .Values.server.env }}
{{ toYaml . | nindent 12 }}
{{- end }}
ports:
- name: http
containerPort: 8880
readinessProbe:
httpGet:
{{- if index .Values.server.extraArgs "http.pathPrefix" }}
path: {{ trimSuffix "/" (index .Values.server.extraArgs "http.pathPrefix") }}/health
{{- else }}
path: /health
{{- end }}
port: http
initialDelaySeconds: 5
periodSeconds: 15
livenessProbe:
tcpSocket:
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
volumeMounts:
- name: alerts-config
mountPath: /config
{{- if .Values.server.persistentVolume.enabled }}
- name: alert-rules-pv
mountPath: {{ .Values.server.persistentVolume.mountPath | default "/alert-rules" }}
{{- with .Values.server.persistentVolume.subPath }}
subPath: {{ . }}
{{- end }}
{{- end }}
{{- range .Values.server.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- with .Values.server.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
{{- with .Values.server.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.server.priorityClassName }}
priorityClassName: {{ .Values.server.priorityClassName | quote }}
{{- end }}
{{- with .Values.server.affinity }}
affinity:
{{ toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.schedulerName }}
schedulerName: "{{ .Values.schedulerName }}"
{{- end }}
nodeSelector:
{{- if .Values.dedicatedValue }}
dedicated: {{ include "meesho.server.dedicatedValue" . }}
{{- else }}
{{- with .Values.server.nodeSelector }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
tolerations:
{{- if .Values.dedicatedValue }}
- key: "dedicated"
operator: "Equal"
value: {{ include "meesho.server.dedicatedValue" . }}
effect: "NoSchedule"
{{- else }}
{{- with .Values.server.tolerations }}
{{ toYaml . | nindent 8 }}
{{- end }}
{{- end }}
volumes:
- name: alerts-config
configMap:
name: {{ include "vmalert.server.configname" . }}
{{- if .Values.server.persistentVolume.enabled }}
- name: alert-rules-pv
persistentVolumeClaim:
claimName: {{ .Values.server.persistentVolume.existingClaim | default (.Values.server.persistentVolume.name | default (printf "%s-alert-rules-pvc" (include "vmalert.server.fullname" .))) }}
{{- end }}
{{- range .Values.server.extraHostPathMounts }}
- name: {{ .name }}
hostPath:
path: {{ .hostPath }}
{{- end }}
{{- with .Values.server.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
@@ -0,0 +1,50 @@
{{- if and .Values.server.enabled .Values.server.ingress.enabled }}
{{- $ingressApiIsStable := eq (include "vmalert.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "vmalert.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "vmalert.ingress.supportsPathType" .) "true" -}}
{{- $servicePort := .Values.server.service.servicePort -}}
{{- $ingressPathType := .Values.server.ingress.pathType -}}
apiVersion: {{ include "vmalert.ingress.apiVersion" . }}
kind: Ingress
metadata:
{{- with .Values.server.ingress.annotations }}
annotations:
{{ toYaml .| indent 4 }}
{{- end }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{ with .Values.server.ingress.extraLabels }}
{{ toYaml . | indent 4 }}
{{ end }}
name: {{ template "vmalert.server.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.server.ingress.ingressClassName }}
ingressClassName: {{ .Values.server.ingress.ingressClassName }}
{{- end }}
rules:
{{- $serviceName := include "vmalert.server.fullname" . }}
{{- range .Values.server.ingress.hosts }}
- host: {{ .name }}
http:
paths:
- path: {{ .path }}
{{- if $ingressSupportsPathType }}
pathType: {{ $ingressPathType }}
{{- end }}
backend:
{{- if $ingressApiIsStable }}
service:
name: {{ $serviceName }}
port:
number: {{ $servicePort }}
{{- else }}
serviceName: {{ $serviceName }}
servicePort: {{ .port | default "http"}}
{{- end }}
{{- end -}}
{{- with .Values.server.ingress.tls }}
tls:
{{ toYaml . | indent 4 }}
{{- end -}}
{{- end -}}
@@ -0,0 +1,26 @@
{{- if .Values.server.podDisruptionBudget.enabled }}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else -}}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "vmalert.server.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.server.podDisruptionBudget.labels }}
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- if .Values.server.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.server.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.server.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.server.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "vmalert.server.matchLabels" . | nindent 6 }}
{{- end }}
@@ -0,0 +1,50 @@
{{- if and .Values.server.enabled -}}
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
{{- with .Values.server.service.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.server.service.labels }}
{{- toYaml . | nindent 4}}
{{- end }}
name: {{ template "vmalert.server.fullname" . }}
spec:
{{- with .Values.server.service.clusterIP }}
clusterIP: {{- . }}
{{- end }}
{{- with .Values.server.service.externalIPs }}
externalIPs:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.service.loadBalancerIP }}
loadBalancerIP: {{- . }}
{{- end }}
{{- with .Values.server.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := . }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.server.service.servicePort }}
targetPort: http
protocol: TCP
{{- with .Values.server.service.nodePort }}
nodePort: {{ . }}
{{- end }}
selector:
{{- include "vmalert.server.matchLabels" . | nindent 4 }}
type: "{{ .Values.server.service.type }}"
{{- with .Values.server.service.healthCheckNodePort }}
healthCheckNodePort: {{ . }}
{{- end }}
{{- with .Values.server.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- end }}
@@ -0,0 +1,44 @@
{{- if .Values.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.serviceMonitor.annotations }}
annotations:
{{ toYaml .Values.serviceMonitor.annotations | indent 4 }}
{{- end }}
labels:
{{- include "vmalert.server.labels" . | nindent 4 }}
{{- with .Values.serviceMonitor.extraLabels -}}
{{ toYaml . | nindent 4 }}
{{- end }}
name: {{ template "vmalert.server.fullname" . }}
{{- if .Values.serviceMonitor.namespace }}
namespace: {{ .Values.serviceMonitor.namespace }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "vmalert.server.matchLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.serviceMonitor.scheme }}
scheme: {{ .Values.serviceMonitor.scheme }}
{{- end }}
{{- if .Values.serviceMonitor.interval }}
interval: {{ .Values.serviceMonitor.interval }}
{{- end }}
{{- if .Values.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- with .Values.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -0,0 +1,13 @@
{{- if .Values.serviceAccount.create -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "vmalert.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "vmalert.common.metaLabels" . | nindent 4 }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
@@ -0,0 +1,711 @@
# Default values for victoria-metrics-alert.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
global:
# -- Image pull secrets, that can be shared across multiple helm charts
imagePullSecrets: []
image:
# -- Image registry, that can be shared across multiple helm charts
registry: ""
# -- Openshift security context compatibility configuration
compatibility:
openshift:
adaptSecurityContext: "auto"
cluster:
# -- K8s cluster domain suffix, uses for building storage pods' FQDN. Details are [here](https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/)
dnsDomain: cluster.local.
serviceAccount:
# -- Specifies whether a service account should be created
create: true
# -- Annotations to add to the service account
annotations: {}
# -- The name of the service account to use.
# If not set and create is true, a name is generated using the fullname template
name:
# -- Mount API token to pod directly
automountToken: true
# -- Override chart name
nameOverride: ""
server:
# -- Override default `app` label name
name: vmalert
# -- VMAlert image configuration
image:
registry: ""
repository: victoriametrics/vmalert
tag: "" # rewrites Chart.AppVersion
# Variant of the image to use.
# e.g. enterprise, scratch
variant: ""
pullPolicy: IfNotPresent
# -- Override vmalert resources fullname
fullnameOverride: vmalert-infra-stg-stateful
# -- Image pull secrets
imagePullSecrets: []
# -- See `kubectl explain poddisruptionbudget.spec` for more. Or check [docs](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
podDisruptionBudget:
enabled: false
# minAvailable: 1
# maxUnavailable: 1
# Labels should be defined in custom-values.yaml override files if needed
# Common labels are already applied via server.labels
labels: {}
# -- Additional environment variables (ex.: secret tokens, flags). Check [here](https://docs.victoriametrics.com/victoriametrics/#environment-variables) for details.
env:
[]
# - name: VM_remoteWrite_basicAuth_password
# valueFrom:
# secretKeyRef:
# name: auth_secret
# key: password
# -- Specify alternative source for env variables
envFrom:
[]
#- configMapRef:
# name: special-config
probe:
# -- Readiness probe
readiness:
httpGet: {}
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
# -- Liveness probe
liveness:
tcpSocket: {}
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
# -- Startup probe
startup: {}
# -- Replica count
replicaCount: 2
# -- Pod topologySpreadConstraints
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
type: vmalert
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
type: vmalert
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: DoNotSchedule
# -- Deployment strategy, set to standard k8s default
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
# -- 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
minReadySeconds: 0
# -- VMAlert reads metrics from source, next section represents its configuration. It can be any service which supports
# MetricsQL or PromQL.
datasource:
url: "http://vmselect-infra-stg.victoriametrics.svc.cluster.local:8481/select/100/prometheus"
# -- Basic auth for datasource
basicAuth:
username: ""
password: ""
# -- Auth based on Bearer token for datasource
bearer:
# -- Token with Bearer token. You can use one of token or tokenFile. You don't need to add "Bearer" prefix string
token: ""
# -- Token Auth file with Bearer token. You can use one of token or tokenFile
tokenFile: ""
remote:
write:
# -- VMAlert remote write URL
url: "http://vminsert-infra-stg.victoriametrics.svc.cluster.local:8480/insert/100/prometheus/"
# -- Basic auth for remote write
basicAuth:
username: ""
password: ""
# -- Auth based on Bearer token for remote write
bearer:
# -- Token with Bearer token. You can use one of token or tokenFile. You don't need to add "Bearer" prefix string
token: ""
# -- Token Auth file with Bearer token. You can use one of token or tokenFile
tokenFile: ""
read:
# -- VMAlert remote read URL
url: "http://vmselect-infra-stg.victoriametrics.svc.cluster.local:8481/select/100/prometheus"
# -- Basic auth for remote read
basicAuth:
username: ""
password: ""
# -- Auth based on Bearer token for remote read
bearer:
# -- Token with Bearer token. You can use one of token or tokenFile. You don't need to add "Bearer" prefix string
token: ""
# -- Token Auth file with Bearer token. You can use one of token or tokenFile
tokenFile: ""
# -- Notifier to use for alerts.
# Multiple notifiers can be enabled by using `notifiers` section
notifier:
alertmanager:
url: "http://alertmanager-infra-stg-0.alertmanager-infra-stg-headless.alertmanager.svc.cluster.local:9093"
# -- Basic auth for alertmanager
basicAuth:
username: ""
password: ""
# -- Auth based on Bearer token for alertmanager
bearer:
# -- Token with Bearer token. You can use one of token or tokenFile. You don't need to add "Bearer" prefix string
token: ""
# -- Token Auth file with Bearer token. You can use one of token or tokenFile
tokenFile: ""
# -- Additional notifiers to use for alerts
notifiers:
- alertmanager:
url: "http://alertmanager-infra-stg-1.alertmanager-infra-stg-headless.alertmanager.svc.cluster.local:9093"
basicAuth:
username: ""
password: ""
bearer:
token: ""
tokenFile: ""
# - alertmanager:
# url: ""
# basicAuth:
# username: ""
# password: ""
# bearer:
# token: ""
# tokenFile: ""
# -- Extra command line arguments for container of component
extraArgs:
envflag.enable: true
envflag.prefix: VM_
loggerFormat: json
httpListenAddr: :8880
rule:
- /alert-rules/**/*.yaml
- /alert-rules/**/*.yml
evaluationInterval: 60s
configCheckInterval: 10s
# -- Additional hostPath mounts
extraHostPathMounts: []
# - name: certs-dir
# mountPath: /etc/kubernetes/certs
# subPath: ""
# hostPath: /etc/kubernetes/certs
# readOnly: true
# -- Extra Volumes for the pod
extraVolumes: []
# - name: example
# configMap:
# name: example
# -- Extra Volume Mounts for the container.
# Expects a lice of [volume mounts](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.26/#volumemount-v1-core)
extraVolumeMounts: []
# - name: example
# mountPath: /example
# subPath: ""
# -- Additional containers to run in the same pod
extraContainers:
[]
#- name: config-reloader
# image: reloader-image
service:
# -- Service annotations
annotations: {}
# -- Service labels
# Labels should be defined in custom-values.yaml override files
labels: {}
# -- Service ClusterIP
clusterIP: ""
# -- Service external IPs. Check [here](https://kubernetes.io/docs/concepts/services-networking/service/#external-ips) for details
externalIPs: []
# -- Service load balancer IP
loadBalancerIP: ""
# -- Load balancer source range
loadBalancerSourceRanges: []
# -- Service port
servicePort: 8880
# nodePort: 30000
# -- Service type
type: ClusterIP
# -- Service external traffic policy. Check [here](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) for details
externalTrafficPolicy: ""
# -- Health check node port for a service. Check [here](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) for details
healthCheckNodePort: ""
# -- Service IP family policy. Check [here](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) for details.
ipFamilyPolicy: ""
# -- List of service IP families. Check [here](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) for details.
ipFamilies: []
ingress:
# -- Enable deployment of ingress for vmalert component
enabled: true
# -- Ingress annotations
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
# -- Ingress extra labels
extraLabels: {}
# -- Array of host objects
hosts:
- name: vmalert-infra-stg-stateful.meeshogcp.in
path:
- /
port: http
# -- Array of TLS objects
tls: []
# - secretName: vmselect-ingress-tls
# hosts:
# - vmselect.local
# -- Ingress controller class name
ingressClassName: "nginx-internal"
# -- Ingress path type
pathType: Prefix
# -- Pod's security context. Details are [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
podSecurityContext:
enabled: true
# fsGroup: 2000
# -- Security context to be added to server pods
securityContext:
enabled: true
# capabilities:
# drop:
# - ALL
# readOnlyRootFilesystem: true
# runAsNonRoot: true
# runAsUser: 1000
# -- Resource object. Details are [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)
resources:
# We usually recommend not to specify default resources and to leave this as a conscious
# choice for the user. This also increases chances charts run on environments with little
# resources, such as Minikube. If you do want to specify resources, uncomment the following
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
# limits:
# cpu: 100m
# memory: 128Mi
requests:
cpu: 500m
memory: 1Gi
# -- Annotations to be added to the deployment
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8880"
# -- Labels to be added to the deployment
# Labels should be defined in custom-values.yaml override files
labels: {}
# -- Annotations to be added to pod
podAnnotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8880"
# -- Pod's additional labels
# Pod labels should be defined in custom-values.yaml override files if needed
# Common labels are already applied via server.labels
podLabels: {}
# -- Pod's node selector. Details are [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
nodeSelector: {}
# dedicated: "vminsert"
# -- Name of Priority Class
priorityClassName: ""
# -- Node tolerations for server scheduling to nodes with taints. Details are [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/)
tolerations: {}
# - key: "dedicated"
# operator: "Equal"
# value: "vminsert"
# effect: "NoSchedule"
# -- Pod affinity
affinity: {}
# -- VMAlert alert rules configuration.
# Use existing configmap if specified
configMap: ""
# -- VMAlert configuration
config:
alerts:
groups: []
# -- Persistent Volume configuration for alert rules
persistentVolume:
# -- Create/use Persistent Volume Claim for alert rules. Empty dir if false
enabled: true
# -- Override Persistent Volume Claim name
name: ""
# -- Array of access modes. Must match those of existing PV or dynamic provisioner. Details are [here](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
accessModes:
- ReadWriteMany
# -- Persistent volume annotations
annotations: {}
# -- PVC extra labels
extraLabels: {}
# -- StorageClass to use for persistent volume. Requires server.persistentVolume.enabled: true. If defined, PVC created automatically
storageClassName: "pulse-nfs-sc-prd"
# -- Existing Claim name. If defined, PVC must be created manually before volume will be bound
existingClaim: ""
# -- Mount path. Alert rules Persistent Volume mount root path.
mountPath: /alert-rules
# -- Mount subpath
subPath: ""
# -- Size of the volume. Better to set the same as resource limit memory property.
size: 10Gi
# -- Vertical Pod Autoscaler
verticalPodAutoscaler:
# -- Use VPA for vmalert
enabled: false
# recommenders:
# - name: 'alternative'
# updatePolicy:
# updateMode: "Auto"
# minReplicas: 1
# resourcePolicy:
# containerPolicies:
# - containerName: '*'
# minAllowed:
# cpu: 100m
# memory: 128Mi
# maxAllowed:
# cpu: 1
# memory: 500Mi
# controlledResources: ["cpu", "memory"]
# -- Additional initContainers to initialize the pod
initContainers: []
serviceMonitor:
# -- Enable deployment of Service Monitor for server component. This is Prometheus operator object
enabled: false
# -- Service Monitor labels
extraLabels: {}
# -- Service Monitor annotations
annotations: {}
# -- Service Monitor relabelings
relabelings: []
# -- Basic auth params for Service Monitor
basicAuth: {}
# -- Service Monitor metricRelabelings
metricRelabelings: []
# interval: 15s
# scrapeTimeout: 5s
# -- Commented. HTTP scheme to use for scraping.
# scheme: https
# -- Commented. TLS configuration to use when scraping the endpoint
# tlsConfig:
# insecureSkipVerify: true
alertmanager:
# -- Create alertmanager resources
enabled: false
# -- Alertmanager Pod labels
podLabels: {}
# -- Override Alertmanager resources fullname
fullnameOverride: ""
# -- Alertmanager Pod annotations
podAnnotations: {}
# -- Alertmanager mode: deployment, statefulSet
mode: deployment
# -- [K8s Deployment](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) specific variables
deployment:
spec:
strategy:
# Must be "Recreate" when we have a persistent volume
type: Recreate
# -- [K8s StatefulSet](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) specific variables
statefulSet:
spec:
# -- Deploy order policy for StatefulSet pods
podManagementPolicy: OrderedReady
# -- StatefulSet update strategy. Check [here](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#update-strategies) for details.
updateStrategy: {}
# type: RollingUpdate
# -- Alertmanager image configuration
image:
registry: ""
repository: prom/alertmanager
tag: v0.27.0
# -- Alertmanager retention
retention: 120h
# -- Replica count
replicaCount: 1
# -- Cluster configuration for alertmanager
cluster:
# -- Cluster listen address
listenAddress: "0.0.0.0:9094"
# -- Cluster push/pull interval
pushPullInterval: 60s
# -- Cluster gossip interval
gossipInterval: 200ms
# -- Cluster peer timeout
peerTimeout: 15s
# -- Cluster settle timeout
settleTimeout: 1m
# -- Pod's node selector. Details are [here](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#nodeselector)
nodeSelector: {}
# -- Name of Priority Class
priorityClassName: ""
# -- Resource object. Details are [here](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/)
resources: {}
# -- Node tolerations for server scheduling to nodes with taints. Details are [here](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/)
tolerations: []
# -- Image pull secrets
imagePullSecrets: []
probe:
# -- Readiness probe
readiness:
httpGet:
path: '{{ ternary "" .app.baseURLPrefix (empty .app.baseURLPrefix) }}/-/ready'
port: web
# -- Liveness probe
liveness:
httpGet:
path: '{{ ternary "" .app.baseURLPrefix (empty .app.baseURLPrefix) }}/-/healthy'
port: web
# -- Startup probe
startup:
httpGet:
path: '{{ ternary "" .app.baseURLPrefix (empty .app.baseURLPrefix) }}/-/ready'
port: web
# -- Pod's security context. Details are [here](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
podSecurityContext:
enabled: false
# -- Security context to be added to server pods
securityContext:
enabled: false
# -- Pod topologySpreadConstraints
topologySpreadConstraints: []
# - maxSkew: 1
# topologyKey: topology.kubernetes.io/zone
# whenUnsatisfiable: DoNotSchedule
# -- Alertmanager listen address
listenAddress: "0.0.0.0:9093"
# -- Extra command line arguments for container of component
extraArgs: {}
# -- Specify alternative source for env variables
envFrom: []
# -- External URL, that alertmanager will expose to receivers
baseURL: ""
# -- External URL Prefix, Prefix for the internal routes of web endpoints
baseURLPrefix: ""
# -- Use existing configmap if specified
# otherwise .config values will be used
configMap: ""
# -- Alertmanager web configuration
webConfig: {}
# -- Alertmanager configuration
config:
global:
resolve_timeout: 5m
route:
# default receiver
receiver: devnull
# tag to group by
group_by: ["alertname"]
# How long to initially wait to send a notification for a group of alerts
group_wait: 30s
# How long to wait before sending a notification about new alerts that are added to a group
group_interval: 10s
# How long to wait before sending a notification again if it has already been sent successfully for an alert
repeat_interval: 24h
receivers:
- name: devnull
# -- Alertmanager extra templates
templates: {}
# alertmanager.tmpl: |-
service:
# -- Service annotations
annotations: {}
# -- Service labels
labels: {}
# -- Service ClusterIP
clusterIP: ""
# -- Service external IPs. Check [here](https://kubernetes.io/docs/concepts/services-networking/service/#external-ips) for details
externalIPs: []
# -- Service load balancer IP
loadBalancerIP: ""
# -- Load balancer source range
loadBalancerSourceRanges: []
# -- Service port
servicePort: 9093
# nodePort: 30000
# -- Service type
type: ClusterIP
# -- Service external traffic policy. Check [here](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) for details
externalTrafficPolicy: ""
# -- Health check node port for a service. Check [here](https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip) for details
healthCheckNodePort: ""
# -- Service IP family policy. Check [here](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) for details.
ipFamilyPolicy: ""
# -- List of service IP families. Check [here](https://kubernetes.io/docs/concepts/services-networking/dual-stack/#services) for details.
ipFamilies: []
ingress:
# -- Enable deployment of ingress for alertmanager component
enabled: false
# -- Ingress annotations
annotations: {}
# kubernetes.io/ingress.class: nginx
# kubernetes.io/tls-acme: 'true'
# -- Ingress extra labels
extraLabels: {}
# -- Array of host objects
hosts:
- name: alertmanager.local
path:
- /
port: web
# -- Array of TLS objects
tls: []
# - secretName: alertmanager-ingress-tls
# hosts:
# - alertmanager.local
# -- Ingress controller class name
ingressClassName: ""
# -- Ingress path type
pathType: Prefix
# -- Empty dir configuration if persistence is disabled for Alertmanager
emptyDir: {}
persistentVolume:
# -- Create/use Persistent Volume Claim for alertmanager component. Empty dir if false
enabled: false
# -- Override Persistent Volume Claim name
name: ""
# -- Array of access modes. Must match those of existing PV or dynamic provisioner. Details are [here](https://kubernetes.io/docs/concepts/storage/persistent-volumes/)
accessModes:
- ReadWriteOnce
# -- Persistent volume annotations
annotations: {}
# -- PVC extra labels
extraLabels: {}
# -- StorageClass to use for persistent volume. Requires alertmanager.persistentVolume.enabled: true. If defined, PVC created automatically
storageClassName: ""
# -- Existing Claim name. If defined, PVC must be created manually before volume will be bound
existingClaim: ""
# -- Mount path. Alertmanager data Persistent Volume mount root path.
mountPath: /data
# -- Mount subpath
subPath: ""
# -- Size of the volume. Better to set the same as resource limit memory property.
size: 50Mi
# -- Additional hostPath mounts
extraHostPathMounts:
[]
# - name: certs-dir
# mountPath: /etc/kubernetes/certs
# subPath: ""
# hostPath: /etc/kubernetes/certs
# readOnly: true
# -- Extra Volumes for the pod
extraVolumes:
[]
#- name: example
# configMap:
# name: example
# -- Extra Volume Mounts for the container
extraVolumeMounts:
[]
# - name: example
# mountPath: /example
# -- Extra containers to run in a pod with alertmanager
extraContainers:
[]
#- name: config-reloader
# image: reloader-image
# -- Additional initContainers to initialize the pod
initContainers: []
# -- Add extra specs dynamically to this chart
extraObjects: []
# -- Enterprise license key configuration for VictoriaMetrics enterprise.
# Required only for VictoriaMetrics enterprise. Check docs [here](https://docs.victoriametrics.com/victoriametrics/enterprise/),
# for more information, visit [site](https://victoriametrics.com/products/enterprise/).
# Request a trial license [here](https://victoriametrics.com/products/enterprise/trial/)
# Supported starting from VictoriaMetrics v1.94.0
license:
# -- License key
key: ""
# -- Use existing secret with license key
secret:
# -- Existing secret name
name: ""
# -- Key in secret with license key
key: ""