Replace Prometheus with VictoriaMetrics (victoria-metrics-single + vmagent)

Lower RAM/disk for the same metric volume on an 8GB single node — VM's
own compression is the entire reason it exists as a project. Speaks
Prometheus's own query API (/api/v1/query), so nothing downstream
needed to change beyond the URL it points at: same PromQL, same
kubernetes-nodes-cadvisor-sourced container_cpu_usage_seconds_total /
container_memory_working_set_bytes toolshed's metrics work
(docs/PRODUCT-ARCHITECTURE.md step 5) already targets.

Three releases, matching the one-release-per-component convention
already used everywhere in this repo, since victoria-metrics-single has
no bundled scraper/exporter subcharts the way the Prometheus chart did:

- victoria-metrics-single: the TSDB + query engine. 3Gi/local-path,
  7-day retention, resources capped at 512Mi — same trim reasoning as
  the Prometheus server it replaces.
- vmagent: the scraper. Its default scrape_configs already includes
  kubernetes-nodes-cadvisor and kubernetes-service-endpoints (the
  chart's own comment says "COPY from Prometheus helm chart") — nothing
  to override there, only remoteWrite pointed at victoria-metrics-single
  and trimmed resources.
- node-exporter: pulled out of the removed Prometheus chart's bundled
  subchart into its own standalone release, since victoria-metrics-single
  has no equivalent. Same trim as before (32Mi/64Mi), same
  prometheus.io/scrape annotation vmagent's default scrape config
  already looks for.

Found and fixed while vendoring: helm-templates/victoria-metrics-single
already existed in this repo — a leftover GKE-targeted vendored copy
from the original Meesho monorepo import (commit b8575bb), with its own
templates/values.yaml for a different chart entirely. `mkdir -p` on an
already-existing directory silently did nothing, so the first vendoring
attempt left that old tree sitting alongside the new one and rendered
two ServiceAccounts/Services/StatefulSets with colliding names. Removed
outright rather than adapted, same reasoning as the ~35 charts
devops-helm-charts removed in its own prune — see this chart's own
Chart.yaml for the full note.

Verified with `helm template` against the real charts and these values
for all three releases individually, and again for the whole
generic-argo-apps-chart appSpec list (11 Applications render, including
the three new ones and nothing orphaned from the old prometheus entry).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Wajog7nELA3i8JWTjxYGHF
This commit is contained in:
Mukul Sharma
2026-09-06 08:38:34 +05:30
co-authored by Claude Opus 5
parent 6677c9e315
commit 04e7ef2f82
37 changed files with 126 additions and 2465 deletions
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: prometheus-node-exporter
repository: https://prometheus-community.github.io/helm-charts
version: 4.56.3
digest: sha256:d82c5d706aab138aaf362814f8bc6f49baf3b8d7b1df751f152902a6940258fd
generated: "2026-09-06T08:31:01.815023+05:30"
+13
View File
@@ -0,0 +1,13 @@
apiVersion: v2
name: node-exporter
version: 1.0.0
dependencies:
- name: prometheus-node-exporter
# Same official chart this ran as a subchart of the (now removed)
# prometheus server chart — vendored standalone here since it exposes
# host metrics over HTTP for any scraper to pull, independent of
# which TSDB stores them. vmagent scrapes it via the
# prometheus.io/scrape annotation this chart's Service carries,
# exactly as the Prometheus server used to.
version: 4.56.3
repository: https://prometheus-community.github.io/helm-charts
-6
View File
@@ -1,6 +0,0 @@
dependencies:
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 29.27.1
digest: sha256:1cd0daed07160b46100e5cccade430dadcd2f9a3974bd3667a09787c603a6ad0
generated: "2026-09-06T07:25:57.847789+05:30"
-10
View File
@@ -1,10 +0,0 @@
apiVersion: v2
name: prometheus
version: 1.0.0
dependencies:
- name: prometheus
# Pinned to the latest stable at the time this was vendored (2026-09).
# Bump deliberately later, with a changelog read first, same as any
# other chart bump in this repo.
version: 29.27.1
repository: https://prometheus-community.github.io/helm-charts
@@ -1,22 +0,0 @@
# 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
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
@@ -0,0 +1,6 @@
dependencies:
- name: victoria-metrics-single
repository: https://victoriametrics.github.io/helm-charts
version: 0.45.0
digest: sha256:5c84351c76bb8a825b95a11a90cf86f8cd2f2b4565135b1241b35dfa9b4e392e
generated: "2026-09-06T08:34:56.682089+05:30"
@@ -1,30 +1,21 @@
apiVersion: v1
appVersion: v1.101.0
description: Victoria Metrics Single version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus
apiVersion: v2
name: victoria-metrics-single
version: 0.9.24
appVersion: v1.101.0
sources:
- https://github.com/VictoriaMetrics/helm-charts
kubeVersion: ">=1.23.0-0"
keywords:
- victoriametrics
- vmsingle
- single
- monitoring
- kubernetes
- observability
- tsdb
- metrics
- metricsql
- timeseries
annotations:
artifacthub.io/license: Apache-2.0
artifacthub.io/category: "monitoring-logging"
artifacthub.io/links: |
- name: Sources
url: https://github.com/VictoriaMetrics/helm-charts
- name: Charts repo
url: https://victoriametrics.github.io/helm-charts/
- name: Docs
url: https://docs.victoriametrics.com/Single-server-VictoriaMetrics.html
version: 1.0.0
dependencies:
- name: victoria-metrics-single
# Pinned to the latest stable at the time this was vendored (2026-09).
# Bump deliberately later, with a changelog read first, same as any
# other chart bump in this repo.
#
# This directory already existed in this repo before this — a
# leftover from the original Meesho monorepo import (commit b8575bb),
# with its own vendored templates/values.yaml for a different,
# GKE-targeted deployment of this same chart. That entire tree was
# removed rather than adapted (same reasoning as the ~35 charts
# removed outright in devops-helm-charts's own prune — see claude.md)
# and replaced with this thin wrapper, matching every other
# official-chart component in this repo (vault, postgresql's sibling
# entries, etc.): a Chart.yaml dependency plus a committed .tgz, no
# local templates of its own.
version: 0.45.0
repository: https://victoriametrics.github.io/helm-charts
File diff suppressed because one or more lines are too long
@@ -1,51 +0,0 @@
{{- if .Values.printNotes }}
{{- if .Values.server.enabled }}
The VictoriaMetrics write api can be accessed via port {{ .Values.server.service.servicePort }} on the following DNS name from within your cluster:
{{ template "victoria-metrics.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local
Metrics Ingestion:
Get the Victoria Metrics service URL by running these commands in the same shell:
{{- if contains "NodePort" .Values.server.service.type }}
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "victoria-metrics.server.fullname" . }})
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
echo http://$NODE_IP:$NODE_PORT
{{- else if contains "LoadBalancer" .Values.server.service.type }}
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
You can watch the status of by running 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "victoria-metrics.server.fullname" . }}'
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "victoria-metrics.server.fullname" . }} -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
echo http://$SERVICE_IP:{{ .Values.server.service.servicePort }}
{{- else if contains "ClusterIP" .Values.server.service.type }}
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app={{ .Values.server.name }}" -o jsonpath="{.items[0].metadata.name}")
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME {{ .Values.server.service.servicePort }}
{{- end }}
Write url inside the kubernetes cluster:
http://{{ template "victoria-metrics.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.server.service.servicePort }}/api/v1/write
{{- if .Values.server.scrape.enabled }}
Metrics Scrape:
Pull-based scrapes are enabled
Scrape config can be displayed by running this command::
{{- if eq .Values.server.scrape.configMap "" }}
kubectl get cm {{ template "victoria-metrics.server.fullname" . }}-scrapeconfig -n {{ .Release.Namespace }}
{{- else }}
kubectl get cm .Values.server.scrape.configMap -n {{ .Release.Namespace }}
{{- end }}
The targets information is accessible via api:
Inside cluster:
http://{{ template "victoria-metrics.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.server.service.servicePort }}/targets
Outside cluster:
You need to port-forward service (see instructions above) and call
http://<service-host-port>/targets
{{- end }}
Read Data:
The following url can be used as the datasource url in Grafana::
http://{{ template "victoria-metrics.server.fullname" . }}.{{ .Release.Namespace }}.svc.cluster.local:{{ .Values.server.service.servicePort }}
{{- end }}
{{- end }}
@@ -1,260 +0,0 @@
{{/* vim: set filetype=mustache: */}}
{{/*
Expand the name of the chart.
*/}}
{{- define "victoria-metrics.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
{{- 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 "victoria-metrics.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 "victoria-metrics.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the service account
*/}}
{{- define "victoria-metrics.serviceAccountName" -}}
{{- if .Values.serviceAccount.create -}}
{{ default (include "victoria-metrics.fullname" .) .Values.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.serviceAccount.name }}
{{- end -}}
{{- end -}}
{{/*
Create unified labels for victoria-metrics components
*/}}
{{- define "victoria-metrics.common.matchLabels" -}}
app.kubernetes.io/name: {{ include "victoria-metrics.name" . }}
app.kubernetes.io/instance: {{ .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- define "victoria-metrics.common.metaLabels" -}}
helm.sh/chart: {{ include "victoria-metrics.chart" . }}
app.kubernetes.io/managed-by: {{ .Release.Service | trunc 63 | trimSuffix "-" }}
{{- end -}}
{{- define "victoria-metrics.server.labels" -}}
{{ include "victoria-metrics.server.matchLabels" . }}
{{ include "victoria-metrics.common.metaLabels" . }}
{{- end -}}
{{- define "victoria-metrics.server.matchLabels" -}}
app: {{ .Values.server.name }}
{{ include "victoria-metrics.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 "victoria-metrics.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 "split-host-port" -}}
{{- $hp := split ":" . -}}
{{- printf "%s" $hp._1 -}}
{{- end -}}
{{/*
Defines the name of scrape configuration map
*/}}
{{- define "victoria-metrics.server.scrape.configname" -}}
{{- if .Values.server.scrape.configMap -}}
{{- .Values.server.scrape.configMap -}}
{{- else -}}
{{- include "victoria-metrics.server.fullname" . -}}-scrapeconfig
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for ingress.
*/}}
{{- define "victoria-metrics.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 "victoria-metrics.ingress.isStable" -}}
{{- eq (include "victoria-metrics.ingress.apiVersion" .) "networking.k8s.io/v1" -}}
{{- end -}}
{{/*
Return if ingress supports ingressClassName.
*/}}
{{- define "victoria-metrics.ingress.supportsIngressClassName" -}}
{{- or (eq (include "victoria-metrics.ingress.isStable" .) "true") (and (eq (include "victoria-metrics.ingress.apiVersion" .) "networking.k8s.io/v1beta1")) -}}
{{- end -}}
{{/*
Return if ingress supports pathType.
*/}}
{{- define "victoria-metrics.ingress.supportsPathType" -}}
{{- or (eq (include "victoria-metrics.ingress.isStable" .) "true") (and (eq (include "victoria-metrics.ingress.apiVersion" .) "networking.k8s.io/v1beta1")) -}}
{{- end -}}
{{- define "victoria-metrics.hasInitContainer" -}}
{{- or (gt (len .Values.server.initContainers) 0) .Values.server.vmbackupmanager.restore.onStart.enabled -}}
{{- end -}}
{{- define "victoria-metrics.initContiners" -}}
{{- if eq (include "victoria-metrics.hasInitContainer" . ) "true" -}}
{{- with .Values.server.initContainers -}}
{{ toYaml . }}
{{- end -}}
{{- if .Values.server.vmbackupmanager.restore.onStart.enabled }}
- name: {{ template "victoria-metrics.name" . }}-vmbackupmanager-restore
image: "{{ .Values.server.vmbackupmanager.image.repository }}:{{ .Values.server.vmbackupmanager.image.tag }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
args:
- restore
- {{ printf "%s=%t" "--eula" .Values.server.vmbackupmanager.eula | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.server.persistentVolume.mountPath | quote}}
{{- range $key, $value := .Values.server.vmbackupmanager.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- with .Values.server.securityContext }}
securityContext: {{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.vmbackupmanager.resources }}
resources: {{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.vmbackupmanager.env }}
env: {{ toYaml . | nindent 4 }}
{{- end }}
ports:
- name: manager-http
containerPort: 8300
volumeMounts:
- name: server-volume
mountPath: {{ .Values.server.persistentVolume.mountPath }}
subPath: {{ .Values.server.persistentVolume.subPath }}
{{- with .Values.server.vmbackupmanager.extraVolumeMounts }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end -}}
{{- else -}}
[]
{{- end -}}
{{- end -}}
{{/*
Return license flag if necessary.
*/}}
{{- define "victoria-metrics.license.flag" -}}
{{- if .Values.license.key -}}
--license={{ .Values.license.key }}
{{- end }}
{{- if and .Values.license.secret.name .Values.license.secret.key -}}
--licenseFile=/etc/vm-license-key/{{ .Values.license.secret.key }}
{{- end -}}
{{- end -}}
{{/*
Return license volume mount
*/}}
{{- define "victoria-metrics.license.volume" -}}
{{- if and .Values.license.secret.name .Values.license.secret.key -}}
- name: license-key
secret:
secretName: {{ .Values.license.secret.name }}
{{- end -}}
{{- end -}}
{{/*
Return license volume mount for container
*/}}
{{- define "victoria-metrics.license.mount" -}}
{{- if and .Values.license.secret.name .Values.license.secret.key -}}
- name: license-key
mountPath: /etc/vm-license-key
readOnly: true
{{- end -}}
{{- end -}}
{{/*
Enforce license for vmbackupmanager
*/}}
{{- define "victoria-metrics.vmbackupmanager.enforce_license" -}}
{{ if and .Values.server.vmbackupmanager.enable (not (or .Values.server.vmbackupmanager.eula .Values.license.key .Values.license.secret.name)) }}
{{ fail `Pass -eula command-line flag or valid license at .Values.license if you have an enterprise license for running this software.
See https://victoriametrics.com/legal/esa/ for details.
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/`}}
{{- end -}}
{{- end -}}
{{/*
Return true if the detected platform is Openshift
Usage:
{{- include "common.compatibility.isOpenshift" . -}}
*/}}
{{- define "common.compatibility.isOpenshift" -}}
{{- if .Capabilities.APIVersions.Has "security.openshift.io/v1" -}}
{{- true -}}
{{- end -}}
{{- end -}}
{{/*
Render a compatible securityContext depending on the platform. By default it is maintained as it is. In other platforms like Openshift we remove default user/group values that do not work out of the box with the restricted-v1 SCC
Usage:
{{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.containerSecurityContext "context" $) -}}
*/}}
{{- define "common.compatibility.renderSecurityContext" -}}
{{- $adaptedContext := .secContext -}}
{{- if .context.Values.global.compatibility -}}
{{- if .context.Values.global.compatibility.openshift -}}
{{- if or (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "force") (and (eq .context.Values.global.compatibility.openshift.adaptSecurityContext "auto") (include "common.compatibility.isOpenshift" .context)) -}}
{{/* Remove incompatible user/group values that do not work in Openshift out of the box */}}
{{- $adaptedContext = omit $adaptedContext "fsGroup" "runAsUser" "runAsGroup" -}}
{{- if not .secContext.seLinuxOptions -}}
{{/* If it is an empty object, we remove it from the resulting context because it causes validation issues */}}
{{- $adaptedContext = omit $adaptedContext "seLinuxOptions" -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- omit $adaptedContext "enabled" | toYaml -}}
{{- end -}}
@@ -1,50 +0,0 @@
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "victoria-metrics.fullname" . }}-clusterrole
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.rbac.extraLabels }}
{{ toYaml .Values.rbac.extraLabels | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
{{- if or .Values.rbac.pspEnabled .Values.server.scrape.enabled }}
rules:
{{- if .Values.server.scrape.enabled }}
- apiGroups:
- discovery.k8s.io
resources:
- endpointslices
verbs: ["get", "list", "watch"]
- apiGroups: [ "" ]
resources:
- nodes
- nodes/proxy
- nodes/metrics
- services
- endpoints
- pods
verbs: [ "get", "list", "watch" ]
- apiGroups:
- extensions
- networking.k8s.io
resources:
- ingresses
verbs: [ "get", "list", "watch" ]
- nonResourceURLs: [ "/metrics" ]
verbs: [ "get" ]
{{- end }}
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [{{ template "victoria-metrics.fullname" . }}]
{{- end }}
{{- else }}
rules: []
{{- end }}
{{- end -}}
@@ -1,23 +0,0 @@
{{- if and .Values.rbac.create (not .Values.rbac.namespaced) }}
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: {{ template "victoria-metrics.fullname" . }}-clusterrolebinding
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.rbac.extraLabels }}
{{ toYaml .Values.rbac.extraLabels | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
subjects:
- kind: ServiceAccount
name: {{ template "victoria-metrics.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
roleRef:
kind: ClusterRole
name: {{ template "victoria-metrics.fullname" . }}-clusterrole
apiGroup: rbac.authorization.k8s.io
{{- end -}}
@@ -1,4 +0,0 @@
{{ range .Values.extraObjects }}
---
{{ tpl (toYaml .) $ }}
{{ end }}
@@ -1,26 +0,0 @@
{{- if .Values.podDisruptionBudget.enabled }}
{{- if .Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" }}
apiVersion: policy/v1
{{- else -}}
apiVersion: policy/v1beta1
{{- end }}
kind: PodDisruptionBudget
metadata:
name: {{ template "victoria-metrics.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.podDisruptionBudget.extraLabels }}
{{ toYaml .Values.podDisruptionBudget.extraLabels | indent 4}}
{{- end }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
{{- include "victoria-metrics.server.matchLabels" . | nindent 6 }}
{{- end }}
@@ -1,42 +0,0 @@
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "victoria-metrics.fullname" . }}
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.rbac.extraLabels }}
{{ toYaml .Values.rbac.extraLabels | indent 4}}
{{- end }}
annotations:
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
{{- if .Values.rbac.annotations }}
{{ toYaml .Values.rbac.annotations | 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 }}
@@ -1,23 +0,0 @@
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: {{ template "victoria-metrics.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.rbac.extraLabels }}
{{ toYaml .Values.rbac.extraLabels | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
rules:
- apiGroups: ['extensions']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames: [{{ template "victoria-metrics.fullname" . }}]
{{- end }}
{{- end }}
@@ -1,26 +0,0 @@
{{- if and .Values.rbac.pspEnabled (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
{{- if .Values.rbac.create -}}
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: {{ template "victoria-metrics.fullname" . }}
namespace: {{ .Release.Namespace }}
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.rbac.extraLabels }}
{{ toYaml .Values.rbac.extraLabels | indent 4}}
{{- end }}
{{- with .Values.rbac.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: {{ template "victoria-metrics.fullname" . }}
subjects:
- kind: ServiceAccount
name: {{ template "victoria-metrics.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
{{- end }}
@@ -1,17 +0,0 @@
{{- if and .Values.server.scrape.enabled (eq .Values.server.scrape.configMap "") }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "victoria-metrics.server.fullname" . }}-scrapeconfig
namespace: {{ .Release.Namespace }}
labels: {{- include "victoria-metrics.server.labels" . | nindent 4 }}
data:
scrape.yml: |
{{- range $k, $v := .Values.server.scrape.config }}
{{- if and (eq $k "scrape_configs") ($.Values.server.scrape.extraScrapeConfigs) }}
{{ dict $k (concat $v $.Values.server.scrape.extraScrapeConfigs) | toYaml | nindent 4 }}
{{- else }}
{{ dict $k $v | toYaml | nindent 4 }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,257 +0,0 @@
{{- if and .Values.server.enabled (not .Values.server.statefulSet.enabled) -}}
{{ include "victoria-metrics.vmbackupmanager.enforce_license" . }}
apiVersion: apps/v1
kind: Deployment
metadata:
{{- if .Values.server.annotations }}
annotations:
{{ toYaml .Values.server.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{- with .Values.server.extraLabels }}
{{ toYaml .}}
{{- end }}
name: {{ template "victoria-metrics.server.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
selector:
matchLabels:
{{- include "victoria-metrics.server.matchLabels" . | nindent 6 }}
replicas: 1
{{- if .Values.server.persistentVolume.enabled }}
strategy:
# Must be "Recreate" when we have a persistent volume
type: Recreate
{{- end }}
template:
metadata:
{{- if .Values.server.podAnnotations }}
annotations:
{{ toYaml .Values.server.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 8 }}
{{- range $key, $value := .Values.server.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.server.priorityClassName }}
priorityClassName: "{{ .Values.server.priorityClassName }}"
{{- end }}
{{- if .Values.server.schedulerName }}
schedulerName: "{{ .Values.server.schedulerName }}"
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- if eq (include "victoria-metrics.hasInitContainer" . ) "true" -}}
initContainers:
{{- include "victoria-metrics.initContiners" . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.server.name }}
{{- if .Values.server.securityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.server.securityContext "context" $) | nindent 12 }}
{{- end }}
image: "{{ .Values.server.image.repository }}:{{ default .Chart.AppVersion .Values.server.image.tag }}{{- with .Values.server.image.variant }}-{{ . }}{{- end }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
{{- if .Values.server.containerWorkingDir }}
workingDir: {{ .Values.server.containerWorkingDir }}
{{- end }}
args:
- {{ printf "%s=%s" "--retentionPeriod" (toString .Values.server.retentionPeriod) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.server.persistentVolume.mountPath | quote}}
{{- if .Values.server.scrape.enabled }}
- --promscrape.config=/scrapeconfig/scrape.yml
{{- end }}
{{- range $key, $value := .Values.server.extraArgs }}
{{- if kindIs "slice" $value }}
{{- range $v := $value }}
- --{{ $key }}={{ $v }}
{{- end }}
{{- else }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- end }}
{{- with (include "victoria-metrics.license.flag" .) }}
- {{ . }}
{{- end }}
{{- if .Values.server.envFrom }}
envFrom:
{{- with .Values.server.envFrom -}}
{{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.server.env }}
env: {{ toYaml . | nindent 10 }}
{{- end }}
ports:
- name: http
containerPort: 8428
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbHTTPListenAddr }}
- name: opentsdbhttp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbHTTPListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
{{- end }}
{{- with $.Values.server.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.startupProbe }}
startupProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{ toYaml .Values.server.resources | indent 12 }}
volumeMounts:
- name: server-volume
mountPath: {{ .Values.server.persistentVolume.mountPath }}
subPath: {{ .Values.server.persistentVolume.subPath }}
{{- if .Values.server.scrape.enabled }}
- name: scrapeconfig
mountPath: /scrapeconfig
{{- end }}
{{- range .Values.server.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.server.extraConfigmapMounts }}
- name: {{ $.Values.server.name }}-{{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.server.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- include "victoria-metrics.license.mount" . | nindent 12 }}
{{- with .Values.server.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.server.vmbackupmanager.enable }}
- name: {{ template "victoria-metrics.name" . }}-vmbackupmanager
image: "{{ .Values.server.vmbackupmanager.image.repository }}:{{ default .Chart.AppVersion .Values.server.vmbackupmanager.image.tag }}{{- with .Values.server.vmbackupmanager.image.variant }}-{{ . }}{{- end }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
args:
- {{ printf "%s=%t" "--eula" .Values.server.vmbackupmanager.eula | quote}}
- {{ printf "%s=%t" "--disableHourly" .Values.server.vmbackupmanager.disableHourly | quote}}
- {{ printf "%s=%t" "--disableDaily" .Values.server.vmbackupmanager.disableDaily | quote}}
- {{ printf "%s=%t" "--disableWeekly" .Values.server.vmbackupmanager.disableWeekly | quote}}
- {{ printf "%s=%t" "--disableMonthly" .Values.server.vmbackupmanager.disableMonthly | quote}}
- {{ printf "%s=%d" "--keepLastHourly" (int .Values.server.vmbackupmanager.retention.keepLastHourly) | quote}}
- {{ printf "%s=%d" "--keepLastDaily" (int .Values.server.vmbackupmanager.retention.keepLastDaily) | quote}}
- {{ printf "%s=%d" "--keepLastWeekly" (int .Values.server.vmbackupmanager.retention.keepLastWeekly) | quote}}
- {{ printf "%s=%d" "--keepLastMonthly" (int .Values.server.vmbackupmanager.retention.keepLastMonthly) | quote}}
- {{ printf "%s=%s" "--dst" (printf "%s/%s" .Values.server.vmbackupmanager.destination (include "victoria-metrics.name" .) ) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.server.persistentVolume.mountPath | quote}}
- "--snapshot.createURL=http://localhost:8428/snapshot/create"
- "--snapshot.deleteURL=http://localhost:8428/snapshot/delete"
{{- range $key, $value := .Values.server.vmbackupmanager.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- with (include "victoria-metrics.license.flag" .) }}
- {{ . }}
{{- end }}
{{- with .Values.server.vmbackupmanager.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.vmbackupmanager.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.vmbackupmanager.readinessProbe }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.server.vmbackupmanager.env }}
env: {{ toYaml . | nindent 12 }}
{{- end }}
ports:
- name: manager-http
containerPort: 8300
volumeMounts:
- name: server-volume
mountPath: {{ .Values.server.persistentVolume.mountPath }}
subPath: {{ .Values.server.persistentVolume.subPath }}
{{- with .Values.server.vmbackupmanager.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- include "victoria-metrics.license.mount" . | nindent 12 }}
{{- end }}
{{- with .Values.server.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.server.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.server.tolerations }}
tolerations:
{{ toYaml .Values.server.tolerations | indent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
volumes:
{{- if .Values.server.scrape.enabled }}
- name: scrapeconfig
configMap:
name: {{ include "victoria-metrics.server.scrape.configname" . }}
{{- end }}
{{- with .Values.server.extraVolumes }}
{{- toYaml . | nindent 6 }}
{{- end }}
- name: server-volume
{{- if .Values.server.persistentVolume.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.server.persistentVolume.existingClaim }}{{ .Values.server.persistentVolume.existingClaim }}{{- else }}{{ template "victoria-metrics.server.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- include "victoria-metrics.license.volume" . | nindent 8 }}
{{- end }}
@@ -1,50 +0,0 @@
{{- if and .Values.server.enabled .Values.server.ingress.enabled }}
{{- $ingressApiIsStable := eq (include "victoria-metrics.ingress.isStable" .) "true" -}}
{{- $ingressSupportsIngressClassName := eq (include "victoria-metrics.ingress.supportsIngressClassName" .) "true" -}}
{{- $ingressSupportsPathType := eq (include "victoria-metrics.ingress.supportsPathType" .) "true" -}}
{{- $servicePort := .Values.server.service.servicePort -}}
{{- $ingressPathType := .Values.server.ingress.pathType -}}
apiVersion: {{ include "victoria-metrics.ingress.apiVersion" . }}
kind: Ingress
metadata:
{{- if .Values.server.ingress.annotations }}
annotations:
{{ toYaml .Values.server.ingress.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{ if .Values.server.ingress.extraLabels }}
{{ toYaml .Values.server.ingress.extraLabels | indent 4 }}
{{ end }}
name: {{ template "victoria-metrics.server.fullname" . }}
namespace: {{ .Release.Namespace }}
spec:
{{- if and $ingressSupportsIngressClassName .Values.server.ingress.ingressClassName }}
ingressClassName: {{ .Values.server.ingress.ingressClassName }}
{{- end }}
rules:
{{- $serviceName := include "victoria-metrics.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 -}}
{{- if .Values.server.ingress.tls }}
tls:
{{ toYaml .Values.server.ingress.tls | indent 4 }}
{{- end -}}
{{- end -}}
@@ -1,33 +0,0 @@
{{- if .Values.server.persistentVolume.enabled -}}
{{- if not .Values.server.statefulSet.enabled -}}
{{- if not .Values.server.persistentVolume.existingClaim -}}
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: {{ template "victoria-metrics.server.fullname" . }}
namespace: {{ .Release.Namespace }}
{{- with .Values.server.persistentVolume.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
spec:
{{- with .Values.server.persistentVolume.accessModes }}
accessModes:
{{ toYaml . | indent 4 }}
{{- end }}
resources:
requests:
storage: {{ .Values.server.persistentVolume.size | quote }}
{{- if .Values.server.persistentVolume.storageClass }}
storageClassName: {{ .Values.server.persistentVolume.storageClass | quote }}
{{- end }}
{{- with .Values.server.persistentVolume.matchLabels }}
selector:
matchLabels:
{{- toYaml . | nindent 6 }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,72 +0,0 @@
{{- if and .Values.server.enabled .Values.server.statefulSet.enabled -}}
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
{{- if .Values.server.statefulSet.service.annotations }}
annotations:
{{ toYaml .Values.server.statefulSet.service.annotations | indent 4}}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{- if .Values.server.statefulSet.service.labels }}
{{ toYaml .Values.server.statefulSet.service.labels | indent 4}}
{{- end }}
name: {{ template "victoria-metrics.server.fullname" . }}
spec:
clusterIP: None
{{- with .Values.server.statefulSet.service.healthCheckNodePort }}
healthCheckNodePort: {{ . }}
{{- end }}
{{- with .Values.server.statefulSet.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
ports:
- name: http
port: {{ .Values.server.statefulSet.service.servicePort }}
protocol: TCP
targetPort: http
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
targetPort: graphite-tcp
{{- end }}
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
targetPort: graphite-udp
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
targetPort: influx-tcp
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
targetPort: influx-udp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbHTTPListenAddr }}
- name: opentsdbhttp
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbHTTPListenAddr }}
targetPort: opentsdbhttp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
targetPort: opentsdb-udp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
targetPort: opentsdb-tcp
{{- end }}
selector:
{{- include "victoria-metrics.server.matchLabels" . | nindent 4 }}
{{- end -}}
@@ -1,48 +0,0 @@
{{- if and .Values.server.enabled .Values.server.serviceMonitor.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
{{- if .Values.server.serviceMonitor.annotations }}
annotations:
{{ toYaml .Values.server.serviceMonitor.annotations | indent 4 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{- if .Values.server.serviceMonitor.extraLabels }}
{{ toYaml .Values.server.serviceMonitor.extraLabels | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.server.fullname" . }}
{{- if .Values.server.serviceMonitor.namespace }}
namespace: {{ .Values.server.serviceMonitor.namespace }}
{{- end }}
spec:
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
selector:
matchLabels:
{{- include "victoria-metrics.server.matchLabels" . | nindent 6 }}
endpoints:
- port: http
{{- if .Values.server.serviceMonitor.scheme }}
scheme: {{ .Values.server.serviceMonitor.scheme }}
{{- end }}
{{- if .Values.server.serviceMonitor.interval }}
interval: {{ .Values.server.serviceMonitor.interval }}
{{- end }}
{{- if .Values.server.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.server.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- with .Values.server.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.serviceMonitor.relabelings }}
relabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.server.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
@@ -1,91 +0,0 @@
{{- if and .Values.server.enabled (not .Values.server.statefulSet.enabled) -}}
apiVersion: v1
kind: Service
metadata:
namespace: {{ .Release.Namespace }}
{{- if .Values.server.service.annotations }}
annotations:
{{ toYaml .Values.server.service.annotations | indent 4}}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{- if .Values.server.service.labels }}
{{ toYaml .Values.server.service.labels | indent 4}}
{{- end }}
name: {{ template "victoria-metrics.server.fullname" . }}
spec:
{{- if .Values.server.service.clusterIP }}
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- if .Values.server.service.externalIPs }}
externalIPs:
{{ toYaml .Values.server.service.externalIPs | indent 4 }}
{{- end }}
{{- if .Values.server.service.loadBalancerIP }}
loadBalancerIP: {{ .Values.server.service.loadBalancerIP }}
{{- end }}
{{- if .Values.server.service.loadBalancerSourceRanges }}
loadBalancerSourceRanges:
{{- range $cidr := .Values.server.service.loadBalancerSourceRanges }}
- {{ $cidr }}
{{- end }}
{{- end }}
ports:
- name: http
port: {{ .Values.server.service.servicePort }}
protocol: TCP
targetPort: http
{{- with .Values.server.service.nodePort }}
nodePort: {{ . }}
{{- end }}
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
targetPort: graphite-tcp
{{- end }}
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
targetPort: graphite-udp
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
targetPort: influx-tcp
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
targetPort: influx-udp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbHTTPListenAddr }}
- name: opentsdbhttp
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbHTTPListenAddr }}
targetPort: opentsdbhttp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-udp
protocol: UDP
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
targetPort: opentsdb-udp
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-tcp
protocol: TCP
port: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
targetPort: opentsdb-tcp
{{- end }}
selector:
{{- include "victoria-metrics.server.matchLabels" . | nindent 4 }}
type: "{{ .Values.server.service.type }}"
{{- with .Values.server.service.healthCheckNodePort }}
healthCheckNodePort: {{ . }}
{{- end }}
{{- with .Values.server.service.externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- end }}
@@ -1,289 +0,0 @@
{{- if and .Values.server.enabled .Values.server.statefulSet.enabled -}}
{{ include "victoria-metrics.vmbackupmanager.enforce_license" . }}
apiVersion: apps/v1
kind: StatefulSet
metadata:
namespace: {{ .Release.Namespace }}
name: {{ template "victoria-metrics.server.fullname" . }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 4 }}
{{- with .Values.server.extraLabels }}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.server.annotations }}
annotations:
{{ toYaml . | nindent 4 }}
{{- end }}
spec:
serviceName: {{ template "victoria-metrics.server.fullname" . }}
selector:
matchLabels:
{{- include "victoria-metrics.server.matchLabels" . | nindent 6 }}
replicas: 1
podManagementPolicy: {{ .Values.server.podManagementPolicy }}
template:
metadata:
{{- if .Values.server.podAnnotations }}
annotations:
{{ toYaml .Values.server.podAnnotations | indent 8 }}
{{- end }}
labels:
{{- include "victoria-metrics.server.labels" . | nindent 8 }}
{{- range $key, $value := .Values.server.podLabels }}
{{ $key }}: {{ $value | quote }}
{{- end }}
spec:
{{- if .Values.server.priorityClassName }}
priorityClassName: "{{ .Values.server.priorityClassName }}"
{{- end }}
{{- if .Values.server.schedulerName }}
schedulerName: "{{ .Values.server.schedulerName }}"
{{- end }}
automountServiceAccountToken: {{ .Values.serviceAccount.automountToken }}
{{- if eq (include "victoria-metrics.hasInitContainer" . ) "true" }}
initContainers:
{{- include "victoria-metrics.initContiners" . | nindent 8 }}
{{- end }}
containers:
- name: {{ template "victoria-metrics.name" . }}-{{ .Values.server.name }}
{{- if .Values.server.securityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.server.securityContext "context" $) | nindent 12 }}
{{- end }}
image: "{{ .Values.server.image.repository }}:{{ default .Chart.AppVersion .Values.server.image.tag }}{{- with .Values.server.image.variant }}-{{ . }}{{- end }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
{{- if .Values.server.containerWorkingDir }}
workingDir: {{ .Values.server.containerWorkingDir }}
{{- end }}
args:
- {{ printf "%s=%s" "--retentionPeriod" (toString .Values.server.retentionPeriod) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.server.persistentVolume.mountPath | quote}}
{{- if .Values.server.scrape.enabled }}
- --promscrape.config=/scrapeconfig/scrape.yml
{{- end }}
{{- range $key, $value := .Values.server.extraArgs }}
{{- if kindIs "slice" $value }}
{{- range $v := $value }}
- --{{ $key }}={{ $v }}
{{- end }}
{{- else }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- end }}
{{- with (include "victoria-metrics.license.flag" .) }}
- {{ . }}
{{- end }}
{{- if .Values.server.envFrom }}
envFrom:
{{- with .Values.server.envFrom -}}
{{ toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- with .Values.server.env }}
env: {{ toYaml . | nindent 10 }}
{{- end }}
ports:
- name: http
containerPort: 8428
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.graphiteListenAddr }}
- name: graphite-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.graphiteListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.influxListenAddr }}
- name: influx-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.influxListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbHTTPListenAddr }}
- name: opentsdbhttp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbHTTPListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-tcp
protocol: TCP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
{{- end }}
{{- if .Values.server.extraArgs.opentsdbListenAddr }}
- name: opentsdb-udp
protocol: UDP
containerPort: {{ include "split-host-port" .Values.server.extraArgs.opentsdbListenAddr }}
{{- end }}
{{- with $.Values.server.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.startupProbe }}
startupProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.server.resources | nindent 12 }}
volumeMounts:
- name: server-volume
mountPath: {{ .Values.server.persistentVolume.mountPath }}
subPath: {{ .Values.server.persistentVolume.subPath }}
{{- if .Values.server.scrape.enabled }}
- name: scrapeconfig
mountPath: /scrapeconfig
{{- end }}
{{- range .Values.server.extraHostPathMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.server.extraConfigmapMounts }}
- name: {{ $.Values.server.name }}-{{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- range .Values.server.extraSecretMounts }}
- name: {{ .name }}
mountPath: {{ .mountPath }}
subPath: {{ .subPath }}
readOnly: {{ .readOnly }}
{{- end }}
{{- include "victoria-metrics.license.mount" . | nindent 12 }}
{{- with .Values.server.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.server.vmbackupmanager.enable }}
- name: {{ template "victoria-metrics.name" . }}-vmbackupmanager
image: "{{ .Values.server.vmbackupmanager.image.repository }}:{{ default .Chart.AppVersion .Values.server.vmbackupmanager.image.tag }}{{- with .Values.server.vmbackupmanager.image.variant }}-{{ . }}{{- end }}"
imagePullPolicy: "{{ .Values.server.image.pullPolicy }}"
args:
- {{ printf "%s=%t" "--eula" .Values.server.vmbackupmanager.eula | quote}}
- {{ printf "%s=%t" "--disableHourly" .Values.server.vmbackupmanager.disableHourly | quote}}
- {{ printf "%s=%t" "--disableDaily" .Values.server.vmbackupmanager.disableDaily | quote}}
- {{ printf "%s=%t" "--disableWeekly" .Values.server.vmbackupmanager.disableWeekly | quote}}
- {{ printf "%s=%t" "--disableMonthly" .Values.server.vmbackupmanager.disableMonthly | quote}}
- {{ printf "%s=%d" "--keepLastHourly" (int .Values.server.vmbackupmanager.retention.keepLastHourly) | quote}}
- {{ printf "%s=%d" "--keepLastDaily" (int .Values.server.vmbackupmanager.retention.keepLastDaily) | quote}}
- {{ printf "%s=%d" "--keepLastWeekly" (int .Values.server.vmbackupmanager.retention.keepLastWeekly) | quote}}
- {{ printf "%s=%d" "--keepLastMonthly" (int .Values.server.vmbackupmanager.retention.keepLastMonthly) | quote}}
- {{ printf "%s=%s" "--dst" (printf "%s/%s" .Values.server.vmbackupmanager.destination (include "victoria-metrics.name" .) ) | quote}}
- {{ printf "%s=%s" "--storageDataPath" .Values.server.persistentVolume.mountPath | quote}}
- "--snapshot.createURL=http://localhost:8428/snapshot/create"
- "--snapshot.deleteURL=http://localhost:8428/snapshot/delete"
{{- range $key, $value := .Values.server.vmbackupmanager.extraArgs }}
- --{{ $key }}={{ $value }}
{{- end }}
{{- with (include "victoria-metrics.license.flag" .) }}
- {{ . }}
{{- end }}
{{- with .Values.server.vmbackupmanager.resources }}
resources: {{ toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.server.securityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.server.securityContext "context" $) | nindent 12 }}
{{- end }}
{{- with $.Values.server.vmbackupmanager.livenessProbe }}
livenessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with $.Values.server.vmbackupmanager.readinessProbe }}
readinessProbe: {{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.server.vmbackupmanager.env }}
env: {{ toYaml . | nindent 12 }}
{{- end }}
ports:
- name: manager-http
containerPort: 8300
volumeMounts:
- name: server-volume
mountPath: {{ .Values.server.persistentVolume.mountPath }}
subPath: {{ .Values.server.persistentVolume.subPath }}
{{- with .Values.server.vmbackupmanager.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
{{- include "victoria-metrics.license.mount" . | nindent 12 }}
{{- end }}
{{- with .Values.server.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .Values.imagePullSecrets }}
imagePullSecrets:
{{ toYaml .Values.imagePullSecrets | indent 2 }}
{{- end }}
{{- if .Values.server.nodeSelector }}
nodeSelector:
{{ toYaml .Values.server.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.server.podSecurityContext.enabled }}
securityContext: {{- include "common.compatibility.renderSecurityContext" (dict "secContext" .Values.server.podSecurityContext "context" $) | nindent 8 }}
{{- end }}
serviceAccountName: {{ template "victoria-metrics.serviceAccountName" . }}
{{- if .Values.server.tolerations }}
tolerations:
{{ toYaml .Values.server.tolerations | indent 8 }}
{{- end }}
{{- with .Values.server.affinity }}
affinity: {{ toYaml . | nindent 8 }}
{{- end }}
terminationGracePeriodSeconds: {{ .Values.server.terminationGracePeriodSeconds }}
volumes:
{{- if .Values.server.scrape.enabled }}
- name: scrapeconfig
configMap:
name: {{ include "victoria-metrics.server.scrape.configname" . }}
{{- end }}
{{- if not .Values.server.persistentVolume.enabled }}
- name: server-volume
emptyDir: {}
{{- else }}
{{- if .Values.server.persistentVolume.existingClaim }}
- name: server-volume
persistentVolumeClaim:
claimName: {{ .Values.server.persistentVolume.existingClaim }}
{{- end }}
{{- end }}
{{- with .Values.server.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- include "victoria-metrics.license.volume" . | nindent 8 }}
{{- if and .Values.server.persistentVolume.enabled (not .Values.server.persistentVolume.existingClaim) }}
volumeClaimTemplates:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: server-volume
{{- if .Values.server.persistentVolume.annotations }}
annotations:
{{ toYaml .Values.server.persistentVolume.annotations | indent 10 }}
{{- end }}
spec:
accessModes:
{{ toYaml .Values.server.persistentVolume.accessModes | indent 10 }}
resources:
requests:
storage: "{{ .Values.server.persistentVolume.size }}"
{{- if .Values.server.persistentVolume.storageClass }}
{{- if (eq "-" .Values.server.persistentVolume.storageClass) }}
storageClassName: ""
{{- else }}
storageClassName: "{{ .Values.server.persistentVolume.storageClass }}"
{{- end }}
{{- end }}
{{- with .Values.server.persistentVolume.matchLabels }}
selector:
matchLabels:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- end }}
@@ -1,16 +0,0 @@
{{- if .Values.serviceAccount.create }}
apiVersion: v1
kind: ServiceAccount
metadata:
labels:
{{- include "victoria-metrics.common.metaLabels" . | nindent 4 }}
{{- if .Values.serviceAccount.extraLabels }}
{{ toYaml .Values.serviceAccount.extraLabels | indent 4}}
{{- end }}
{{- with .Values.serviceAccount.annotations }}
annotations:
{{ toYaml . | indent 4 }}
{{- end }}
name: {{ template "victoria-metrics.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}
@@ -1,710 +0,0 @@
# Default values for victoria-metrics.
# This is a YAML-formatted file.
# Declare variables to be passed into your templates.
global:
compatibility:
openshift:
adaptSecurityContext: "auto"
rbac:
create: true
# Note: The PSP will only be deployed, if Kubernetes (<1.25) supports the resource.
pspEnabled: true
namespaced: false
extraLabels: {}
# annotations: {}
# -- Print chart notes
printNotes: true
serviceAccount:
# -- Create service account.
create: true
# name:
extraLabels: {}
# annotations: {}
# -- Mount API token to pod directly
automountToken: true
automountServiceAccountToken: true
podDisruptionBudget:
# -- See `kubectl explain poddisruptionbudget.spec` for more. Ref: [https://kubernetes.io/docs/tasks/run-application/configure-pdb/](https://kubernetes.io/docs/tasks/run-application/configure-pdb/)
enabled: false
# minAvailable: 1
# maxUnavailable: 1
extraLabels: {}
server:
# -- Enable deployment of server component. Deployed as StatefulSet
enabled: true
# -- Server container name
name: server
image:
# -- Image repository
repository: victoriametrics/victoria-metrics
# -- Image tag
tag: "" # rewrites Chart.AppVersion
# Variant of the image tag to use.
# e.g. enterprise.
variant: ""
# -- Image pull policy
pullPolicy: IfNotPresent
# -- Name of Priority Class
priorityClassName: ""
# -- Overrides the full name of server component
fullnameOverride:
# -- Data retention period in month
retentionPeriod: 1
# Extra command line arguments for container of component
extraArgs:
envflag.enable: "true"
envflag.prefix: VM_
loggerFormat: json
# 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
extraContainers:
[]
#- name: config-reloader
# image: reloader-image
initContainers:
[]
# - name: vmrestore
# image: victoriametrics/vmrestore:latest
# volumeMounts:
# - mountPath: /storage
# name: vmstorage-volume
# - mountPath: /etc/vm/creds
# name: secret-remote-storage-keys
# readOnly: true
# args:
# - -storageDataPath=/storage
# - -src=s3://your_bucket/folder/latest
# - -credsFilePath=/etc/vm/creds/credentials
# -- Node tolerations for server scheduling to nodes with taints. Ref: [https://kubernetes.io/docs/concepts/configuration/assign-pod-node/](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/)
tolerations:
[]
# - key: "key"
# operator: "Equal|Exists"
# value: "value"
# effect: "NoSchedule|PreferNoSchedule"
# -- Pod's node selector. Ref: [https://kubernetes.io/docs/user-guide/node-selection/](https://kubernetes.io/docs/user-guide/node-selection/)
nodeSelector: {}
# -- Pod affinity
affinity: {}
# -- Env variables
# -- Additional environment variables (ex.: secret tokens, flags) https://github.com/VictoriaMetrics/VictoriaMetrics#environment-variables
env: []
envFrom: []
#- configMapRef:
# name: special-config
# -- Container workdir
containerWorkingDir: ""
## Use an alternate scheduler, e.g. "stork".
## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
##
# schedulerName:
persistentVolume:
# -- Create/use Persistent Volume Claim for server component. Empty dir if false
enabled: true
# -- 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/)
accessModes:
- ReadWriteOnce
# -- Persistant volume annotations
annotations: {}
# -- StorageClass to use for persistent volume. Requires server.persistentVolume.enabled: true. If defined, PVC created automatically
storageClass: ""
# -- Existing Claim name. If defined, PVC must be created manually before volume will be bound
existingClaim: ""
# -- Bind Persistent Volume by labels. Must match all labels of targeted PV.
matchLabels: {}
# -- Mount path. Server data Persistent Volume mount root path.
mountPath: /storage
# -- Mount subpath
subPath: ""
# -- Size of the volume. Should be calculated based on the metrics you send and retention policy you set.
size: 16Gi
# -- Sts/Deploy additional labels
extraLabels: {}
# -- Pod's additional labels
podLabels: {}
# -- Pod's annotations
podAnnotations: {}
# -- Pod's management policy
podManagementPolicy: OrderedReady
# -- Resource object. Ref: [http://kubernetes.io/docs/user-guide/compute-resources/](http://kubernetes.io/docs/user-guide/compute-resources/
resources:
{}
# limits:
# cpu: 500m
# memory: 512Mi
# requests:
# cpu: 500m
# memory: 512Mi
# Indicates whether the Container is ready to service requests. If the readiness probe fails, the endpoints controller removes the Pod's IP address from the endpoints of all Services that match the Pod. The default state of readiness before the initial delay is Failure. If a Container does not provide a readiness probe, the default state is Success.
readinessProbe:
httpGet:
path: /health
port: http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
# Indicates whether the Container is running. If the liveness probe fails, the kubelet kills the Container, and the Container is subjected to its restart policy. If a Container does not provide a liveness probe, the default state is Success.
livenessProbe:
httpGet:
scheme: HTTP
path: /health
port: 8428
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 10
# Indicates whether the Container is done with potentially costly initialization. If set it is executed first. If it fails Container is restarted. If it succeeds liveness and readiness probes takes over.
startupProbe: {}
#tcpSocket:
# port: http
#failureThreshold: 30
#periodSeconds: 15
#successThreshold: 1
#timeoutSeconds: 5
# -- Security context to be added to server pods
securityContext:
enabled: true
# -- Pod's security context. Ref: [https://kubernetes.io/docs/tasks/configure-pod-container/security-context/](https://kubernetes.io/docs/tasks/configure-pod-container/security-context/)
podSecurityContext:
enabled: true
ingress:
# -- Enable deployment of ingress for server 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: vmselect.local
# path: /select
# port: http
# -- Array of TLS objects
tls: []
# - secretName: vmselect-ingress-tls
# hosts:
# - vmselect.local
# For Kubernetes >= 1.18 you should specify the ingress-controller via the field ingressClassName
# See https://kubernetes.io/blog/2020/04/02/improvements-to-the-ingress-api-in-kubernetes-1.18/#specifying-the-class-of-an-ingress
# ingressClassName: nginx
# -- pathType is only for k8s >= 1.1=
pathType: Prefix
vmbackupmanager:
# -- enable automatic creation of backup via vmbackupmanager. vmbackupmanager is part of Enterprise packages
enable: false
# -- should be true and means that you have the legal right to run a backup manager
# that can either be a signed contract or an email with confirmation to run the service in a trial period
# # https://victoriametrics.com/legal/esa/
eula: false
image:
# -- vmbackupmanager image repository
repository: victoriametrics/vmbackupmanager
# -- vmbackupmanager image tag
tag: v1.101.0-enterprise
# Variant of the image tag to use.
# e.g. enterprise.
variant: ""
# -- disable hourly backups
disableHourly: false
# -- disable daily backups
disableDaily: false
# -- disable weekly backups
disableWeekly: false
# -- disable monthly backups
disableMonthly: false
# -- backup destination at S3, GCS or local filesystem. Release name will be included to path!
destination: ""
# -- backups' retention settings
retention:
# -- keep last N hourly backups. 0 means delete all existing hourly backups. Specify -1 to turn off
keepLastHourly: 2
# -- keep last N daily backups. 0 means delete all existing daily backups. Specify -1 to turn off
keepLastDaily: 2
# -- keep last N weekly backups. 0 means delete all existing weekly backups. Specify -1 to turn off
keepLastWeekly: 2
# -- keep last N monthly backups. 0 means delete all existing monthly backups. Specify -1 to turn off
keepLastMonthly: 2
extraArgs:
envflag.enable: "true"
envflag.prefix: VM_
loggerFormat: json
# Extra Volume Mounts for the container
extraVolumeMounts:
[]
# - name: example
# mountPath: /example
# -- Allows to enable restore options for pod.
# Read more: https://docs.victoriametrics.com/vmbackupmanager.html#restore-commands
restore:
onStart:
enabled: false
resources: {}
# -- Additional environment variables (ex.: secret tokens, flags) https://github.com/VictoriaMetrics/VictoriaMetrics#environment-variables
env: []
readinessProbe:
httpGet:
path: /health
port: manager-http
initialDelaySeconds: 5
periodSeconds: 15
timeoutSeconds: 5
failureThreshold: 3
livenessProbe:
tcpSocket:
port: manager-http
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 10
service:
# -- Service annotations
annotations: {}
# -- Service labels
labels: {}
# -- Service ClusterIP
clusterIP: ""
# -- Service External IPs. Ref: [https://kubernetes.io/docs/user-guide/services/#external-ips]( https://kubernetes.io/docs/user-guide/services/#external-ips)
externalIPs: []
# -- Service load balacner IP
loadBalancerIP: ""
# -- Load balancer source range
loadBalancerSourceRanges: []
# -- Service port
servicePort: 8428
# -- Node port
# nodePort: 30000
# -- Service type
type: ClusterIP
# Ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
# externalTrafficPolicy: "local"
# healthCheckNodePort: 0
statefulSet:
# -- Creates statefulset instead of deployment, useful when you want to keep the cache
enabled: true
# -- Deploy order policy for StatefulSet pods
podManagementPolicy: OrderedReady
# Headless service for statefulset
service:
# -- Headless service annotations
annotations: {}
# -- Headless service labels
labels: {}
# -- Headless service port
servicePort: 8428
# Ref: https://kubernetes.io/docs/tasks/access-application-cluster/create-external-load-balancer/#preserving-the-client-source-ip
# externalTrafficPolicy: "local"
# healthCheckNodePort: 0
# -- Pod's termination grace period in seconds
terminationGracePeriodSeconds: 60
serviceMonitor:
# -- Enable deployment of Service Monitor for server component. This is Prometheus operator object
enabled: false
# -- Service Monitor labels
extraLabels: {}
# -- Service Monitor annotations
annotations: {}
# -- Commented. Prometheus scrape interval for server component
# interval: 15s
# -- Commented. Prometheus pre-scrape timeout for server component
# scrapeTimeout: 5s
# -- Commented. HTTP scheme to use for scraping.
# scheme: https
# -- Commented. TLS configuration to use when scraping the endpoint
# tlsConfig:
# insecureSkipVerify: true
# -- Service Monitor relabelings
relabelings: []
# -- Service Monitor metricRelabelings
metricRelabelings: []
# -- Scrape configuration for victoriametrics
scrape:
# -- If true scrapes targets, creates config map or use specified one with scrape targets
enabled: false
# -- Use existing configmap if specified
# otherwise .config values will be used
configMap: ""
# -- Scrape config
config:
global:
scrape_interval: 15s
# -- Scrape targets
scrape_configs:
# -- Scrape rule for scrape victoriametrics
- job_name: victoriametrics
static_configs:
- targets: [ "localhost:8428" ]
## COPY from Prometheus helm chart https://github.com/helm/charts/blob/master/stable/prometheus/values.yaml
# -- Scrape config for API servers.
#
# Kubernetes exposes API servers as endpoints to the default/kubernetes
# service so this uses `endpoints` role and uses relabelling to only keep
# the endpoints associated with the default/kubernetes service using the
# default named port `https`. This works for single API server deployments as
# well as HA API server deployments.
- job_name: "kubernetes-apiservers"
kubernetes_sd_configs:
- role: endpoints
# Default to scraping over https. If required, just disable this or change to
# `http`.
scheme: https
# This TLS & bearer token file config is used to connect to the actual scrape
# endpoints for cluster components. This is separate to discovery auth
# configuration because discovery & scraping are two separate concerns in
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
# the cluster. Otherwise, more config options have to be provided within the
# <kubernetes_sd_config>.
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
# If your node certificates are self-signed or use a different CA to the
# master CA, then you need to disable certificate verification. Note that
# certificate verification is an integral part of a secure infrastructure
# so this should only be disabled in a controlled environment. You can
# enable certificate verification by commenting the line below.
#
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
# Keep only the default/kubernetes service endpoints for the https port. This
# will add targets for each API server which Kubernetes adds an endpoint to
# the default/kubernetes service.
relabel_configs:
- source_labels:
[
__meta_kubernetes_namespace,
__meta_kubernetes_service_name,
__meta_kubernetes_endpoint_port_name,
]
action: keep
regex: default;kubernetes;https
# -- Scrape rule using kubernetes service discovery for nodes
- job_name: "kubernetes-nodes"
# Default to scraping over https. If required, just disable this or change to
# `http`.
scheme: https
# This TLS & bearer token file config is used to connect to the actual scrape
# endpoints for cluster components. This is separate to discovery auth
# configuration because discovery & scraping are two separate concerns in
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
# the cluster. Otherwise, more config options have to be provided within the
# <kubernetes_sd_config>.
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
# If your node certificates are self-signed or use a different CA to the
# master CA, then you need to disable certificate verification. Note that
# certificate verification is an integral part of a secure infrastructure
# so this should only be disabled in a controlled environment. You can
# enable certificate verification by commenting the line below.
#
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: kubernetes.default.svc:443
- source_labels: [ __meta_kubernetes_node_name ]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/$1/proxy/metrics
# -- Scrape rule using kubernetes service discovery for cadvisor
- job_name: "kubernetes-nodes-cadvisor"
# Default to scraping over https. If required, just disable this or change to
# `http`.
scheme: https
# This TLS & bearer token file config is used to connect to the actual scrape
# endpoints for cluster components. This is separate to discovery auth
# configuration because discovery & scraping are two separate concerns in
# Prometheus. The discovery auth config is automatic if Prometheus runs inside
# the cluster. Otherwise, more config options have to be provided within the
# <kubernetes_sd_config>.
tls_config:
ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
# If your node certificates are self-signed or use a different CA to the
# master CA, then you need to disable certificate verification. Note that
# certificate verification is an integral part of a secure infrastructure
# so this should only be disabled in a controlled environment. You can
# enable certificate verification by commenting the line below.
#
insecure_skip_verify: true
bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
kubernetes_sd_configs:
- role: node
# This configuration will work only on kubelet 1.7.3+
# As the scrape endpoints for cAdvisor have changed
# if you are using older version you need to change the replacement to
# replacement: /api/v1/nodes/$1:4194/proxy/metrics
# more info here https://github.com/coreos/prometheus-operator/issues/633
relabel_configs:
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
- target_label: __address__
replacement: kubernetes.default.svc:443
- source_labels: [ __meta_kubernetes_node_name ]
regex: (.+)
target_label: __metrics_path__
replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
# ignore timestamps of cadvisor's metrics by default
# more info here https://github.com/VictoriaMetrics/VictoriaMetrics/issues/4697#issuecomment-1656540535
honor_timestamps: false
# -- Scrape config for service endpoints.
#
# The relabeling allows the actual service scrape endpoint to be configured
# via the following annotations:
#
# * `prometheus.io/scrape`: Only scrape services that have a value of `true`
# * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
# to set this to `https` & most likely set the `tls_config` of the scrape config.
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: If the metrics are exposed on a different port to the
# service then set this appropriately.
# -- Scrape rule using kubernetes service discovery for endpoints
- job_name: "kubernetes-service-endpoints"
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: drop
source_labels: [ __meta_kubernetes_pod_container_init ]
regex: true
- action: keep_if_equal
source_labels: [ __meta_kubernetes_service_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number ]
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scrape ]
action: keep
regex: true
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scheme ]
action: replace
target_label: __scheme__
regex: (https?)
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_path ]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels:
[
__address__,
__meta_kubernetes_service_annotation_prometheus_io_port,
]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
action: replace
target_label: kubernetes_namespace
- source_labels: [ __meta_kubernetes_service_name ]
action: replace
target_label: kubernetes_name
- source_labels: [ __meta_kubernetes_pod_node_name ]
action: replace
target_label: kubernetes_node
# -- Scrape config for slow service endpoints; same as above, but with a larger
# timeout and a larger interval
#
# The relabeling allows the actual service scrape endpoint to be configured
# via the following annotations:
#
# * `prometheus.io/scrape-slow`: Only scrape services that have a value of `true`
# * `prometheus.io/scheme`: If the metrics endpoint is secured then you will need
# to set this to `https` & most likely set the `tls_config` of the scrape config.
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: If the metrics are exposed on a different port to the
# service then set this appropriately.
- job_name: "kubernetes-service-endpoints-slow"
scrape_interval: 5m
scrape_timeout: 30s
kubernetes_sd_configs:
- role: endpoints
relabel_configs:
- action: drop
source_labels: [ __meta_kubernetes_pod_container_init ]
regex: true
- action: keep_if_equal
source_labels: [ __meta_kubernetes_service_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number ]
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scrape_slow ]
action: keep
regex: true
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_scheme ]
action: replace
target_label: __scheme__
regex: (https?)
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_path ]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels:
[
__address__,
__meta_kubernetes_service_annotation_prometheus_io_port,
]
action: replace
target_label: __address__
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
action: replace
target_label: kubernetes_namespace
- source_labels: [ __meta_kubernetes_service_name ]
action: replace
target_label: kubernetes_name
- source_labels: [ __meta_kubernetes_pod_node_name ]
action: replace
target_label: kubernetes_node
# -- Example scrape config for probing services via the Blackbox Exporter.
#
# The relabeling allows the actual service scrape endpoint to be configured
# via the following annotations:
#
# * `prometheus.io/probe`: Only probe services that have a value of `true`
- job_name: "kubernetes-services"
metrics_path: /probe
params:
module: [ http_2xx ]
kubernetes_sd_configs:
- role: service
relabel_configs:
- source_labels:
[ __meta_kubernetes_service_annotation_prometheus_io_probe ]
action: keep
regex: true
- source_labels: [ __address__ ]
target_label: __param_target
- target_label: __address__
replacement: blackbox
- source_labels: [ __param_target ]
target_label: instance
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
target_label: kubernetes_namespace
- source_labels: [ __meta_kubernetes_service_name ]
target_label: kubernetes_name
# -- Example scrape config for pods
#
# The relabeling allows the actual pod scrape endpoint to be configured via the
# following annotations:
#
# * `prometheus.io/scrape`: Only scrape pods that have a value of `true`
# * `prometheus.io/path`: If the metrics path is not `/metrics` override this.
# * `prometheus.io/port`: Scrape the pod on the indicated port instead of the default of `9102`.
- job_name: "kubernetes-pods"
kubernetes_sd_configs:
- role: pod
relabel_configs:
- action: drop
source_labels: [ __meta_kubernetes_pod_container_init ]
regex: true
- action: keep_if_equal
source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_port, __meta_kubernetes_pod_container_port_number ]
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_scrape ]
action: keep
regex: true
- source_labels: [ __meta_kubernetes_pod_annotation_prometheus_io_path ]
action: replace
target_label: __metrics_path__
regex: (.+)
- source_labels:
[ __address__, __meta_kubernetes_pod_annotation_prometheus_io_port ]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target_label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source_labels: [ __meta_kubernetes_namespace ]
action: replace
target_label: kubernetes_namespace
- source_labels: [ __meta_kubernetes_pod_name ]
action: replace
target_label: kubernetes_pod_name
## End of COPY
# -- Extra scrape configs that will be appended to `server.scrape.config`
extraScrapeConfigs: []
# -- Add extra specs dynamically to this chart
extraObjects: []
# -- 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:
# -- License key
key: ""
# -- Use existing secret with license key
secret:
# -- Existing secret name
name: ""
# -- Key in secret with license key
key: ""
+6
View File
@@ -0,0 +1,6 @@
dependencies:
- name: victoria-metrics-agent
repository: https://victoriametrics.github.io/helm-charts
version: 0.46.0
digest: sha256:83bcccc6caa7dafc428ba1189bb9f6943d829ec9bbc7c7954a9186809a409579
generated: "2026-09-06T08:29:36.022454+05:30"
+7
View File
@@ -0,0 +1,7 @@
apiVersion: v2
name: vmagent
version: 1.0.0
dependencies:
- name: victoria-metrics-agent
version: 0.46.0
repository: https://victoriametrics.github.io/helm-charts