VictoriaMetrics/docs/helm/victoria-metrics-single/README.md
Github Actions 8f5e0ebbb4
Automatic update helm docs from VictoriaMetrics/helm-charts@f0e007f (#7059)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Signed-off-by: Github Actions <133988544+victoriametrics-bot@users.noreply.github.com>
Co-authored-by: AndrewChubatiuk <3162380+AndrewChubatiuk@users.noreply.github.com>
2024-09-20 17:38:55 +02:00

55 KiB
Raw Blame History

Type: application Version: 0.11.2 Artifact Hub

Victoria Metrics Single version - high-performance, cost-effective and scalable TSDB, long-term remote storage for Prometheus

Prerequisites

  • Install the follow packages: git, kubectl, helm, helm-docs. See this tutorial.
  • PV support on underlying infrastructure.

Chart Details

This chart will do the following:

  • Rollout Victoria Metrics Single.

How to install

Access a Kubernetes cluster.

Setup chart repository (can be omitted for OCI repositories)

Add a chart helm repository with follow commands:

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

helm repo update

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

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

Install victoria-metrics-single chart

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

  • For HTTPS repository

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

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

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

Test the installation with command:

  • For HTTPS repository

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

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

Install chart with command:

  • For HTTPS repository

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

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

Get the pods lists by running this commands:

kubectl get pods -A | grep 'vms'

Get the application by running this command:

helm list -f vms -n NAMESPACE

See the history of versions of vms application with command.

helm history vms -n NAMESPACE

How to uninstall

Remove application with command.

helm uninstall vms -n NAMESPACE

Documentation of Helm Chart

Install helm-docs following the instructions on this tutorial.

Generate docs with helm-docs command.

cd charts/victoria-metrics-single

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-single/values.yaml file.

Key Type Default Description
automountServiceAccountToken bool
true
extraObjects list
[]

Add extra specs dynamically to this chart

global.compatibility.openshift.adaptSecurityContext string
auto
global.image.registry string
""
global.imagePullSecrets list
[]
license object
key: ""
secret:
    key: ""
    name: ""

Enterprise license key configuration for VictoriaMetrics enterprise. Required only for VictoriaMetrics enterprise. Documentation - https://docs.victoriametrics.com/enterprise, 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.key string
""

License key

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

Use existing secret with license key

license.secret.key string
""

Key in secret with license key

license.secret.name string
""

Existing secret name

podDisruptionBudget.enabled bool
false

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

podDisruptionBudget.extraLabels object
{}
printNotes bool
true

Print chart notes

rbac.create bool
true
rbac.extraLabels object
{}
rbac.namespaced bool
false
server.affinity object
{}

Pod affinity

server.containerWorkingDir string
""

Container workdir

server.emptyDir object
{}
server.enabled bool
true

Enable deployment of server component. Deployed as StatefulSet

server.env list
[]

Additional environment variables (ex.: secret tokens, flags) https://docs.victoriametrics.com/#environment-variables

server.envFrom list
[]
server.extraArgs."envflag.enable" string
"true"
server.extraArgs."envflag.prefix" string
VM_
server.extraArgs.loggerFormat string
json
server.extraContainers list
[]
server.extraHostPathMounts list
[]
server.extraLabels object
{}

Sts/Deploy additional labels

server.extraVolumeMounts list
[]
server.extraVolumes list
[]
server.fullnameOverride string
null

Overrides the full name of server component

server.image.pullPolicy string
IfNotPresent

Image pull policy

server.image.registry string
""

Image registry

server.image.repository string
victoriametrics/victoria-metrics

Image repository

server.image.tag string
""

Image tag

server.image.variant string
""
server.imagePullSecrets list
[]
server.ingress.annotations object
{}

Ingress annotations

server.ingress.enabled bool
false

Enable deployment of ingress for server component

server.ingress.extraLabels object
{}

Ingress extra labels

server.ingress.hosts list
[]

Array of host objects

server.ingress.pathType string
Prefix

pathType is only for k8s >= 1.1=

server.ingress.tls list
[]

Array of TLS objects

server.initContainers list
[]
server.name string
server

Server container name

server.nodeSelector object
{}

Pods node selector. Details are here

server.persistentVolume.accessModes list
- ReadWriteOnce

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

server.persistentVolume.annotations object
{}

Persistant volume annotations

server.persistentVolume.enabled bool
true

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

server.persistentVolume.existingClaim string
""

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

server.persistentVolume.matchLabels object
{}

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

server.persistentVolume.mountPath string
/storage

Mount path. Server data Persistent Volume mount root path.

server.persistentVolume.size string
16Gi

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

server.persistentVolume.storageClassName string
""

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

server.persistentVolume.subPath string
""

Mount subpath

server.podAnnotations object
{}

Pods annotations

server.podLabels object
{}

Pods additional labels

server.podManagementPolicy string
OrderedReady

Pods management policy

server.podSecurityContext object
enabled: true

Pods security context. Details are here

server.priorityClassName string
""

Name of Priority Class

server.probe.liveness.failureThreshold int
10
server.probe.liveness.initialDelaySeconds int
30
server.probe.liveness.periodSeconds int
30
server.probe.liveness.tcpSocket object
{}
server.probe.liveness.timeoutSeconds int
5
server.probe.readiness.failureThreshold int
3
server.probe.readiness.httpGet object
{}
server.probe.readiness.initialDelaySeconds int
5
server.probe.readiness.periodSeconds int
15
server.probe.readiness.timeoutSeconds int
5
server.probe.startup object
{}
server.relabel object
config: []
configMap: ""
enabled: false

Global relabel configuration

server.relabel.configMap string
""

Use existing configmap if specified otherwise .config values will be used. Relabel config should reside under relabel.yml key

server.replicaCount int
1

Replica count

server.resources object
{}

Resource object. Details are here

server.retentionPeriod int
1

Data retention period in month

server.scrape object
config:
    global:
        scrape_interval: 15s
    scrape_configs:
        - job_name: victoriametrics
          static_configs:
            - targets:
                - localhost:8428
        - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
          job_name: kubernetes-apiservers
          kubernetes_sd_configs:
            - role: endpoints
          relabel_configs:
            - action: keep
              regex: default;kubernetes;https
              source_labels:
                - __meta_kubernetes_namespace
                - __meta_kubernetes_service_name
                - __meta_kubernetes_endpoint_port_name
          scheme: https
          tls_config:
            ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
            insecure_skip_verify: true
        - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
          job_name: kubernetes-nodes
          kubernetes_sd_configs:
            - role: node
          relabel_configs:
            - action: labelmap
              regex: __meta_kubernetes_node_label_(.+)
            - replacement: kubernetes.default.svc:443
              target_label: __address__
            - regex: (.+)
              replacement: /api/v1/nodes/$1/proxy/metrics
              source_labels:
                - __meta_kubernetes_node_name
              target_label: __metrics_path__
          scheme: https
          tls_config:
            ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
            insecure_skip_verify: true
        - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
          honor_timestamps: false
          job_name: kubernetes-nodes-cadvisor
          kubernetes_sd_configs:
            - role: node
          relabel_configs:
            - action: labelmap
              regex: __meta_kubernetes_node_label_(.+)
            - replacement: kubernetes.default.svc:443
              target_label: __address__
            - regex: (.+)
              replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
              source_labels:
                - __meta_kubernetes_node_name
              target_label: __metrics_path__
          scheme: https
          tls_config:
            ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
            insecure_skip_verify: true
        - job_name: kubernetes-service-endpoints
          kubernetes_sd_configs:
            - role: endpoints
          relabel_configs:
            - action: drop
              regex: true
              source_labels:
                - __meta_kubernetes_pod_container_init
            - action: keep_if_equal
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_port
                - __meta_kubernetes_pod_container_port_number
            - action: keep
              regex: true
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_scrape
            - action: replace
              regex: (https?)
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_scheme
              target_label: __scheme__
            - action: replace
              regex: (.+)
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_path
              target_label: __metrics_path__
            - action: replace
              regex: ([^:]+)(?::\d+)?;(\d+)
              replacement: $1:$2
              source_labels:
                - __address__
                - __meta_kubernetes_service_annotation_prometheus_io_port
              target_label: __address__
            - action: labelmap
              regex: __meta_kubernetes_service_label_(.+)
            - action: replace
              source_labels:
                - __meta_kubernetes_namespace
              target_label: namespace
            - action: replace
              source_labels:
                - __meta_kubernetes_service_name
              target_label: service
            - action: replace
              source_labels:
                - __meta_kubernetes_pod_node_name
              target_label: node
        - job_name: kubernetes-service-endpoints-slow
          kubernetes_sd_configs:
            - role: endpoints
          relabel_configs:
            - action: drop
              regex: true
              source_labels:
                - __meta_kubernetes_pod_container_init
            - action: keep_if_equal
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_port
                - __meta_kubernetes_pod_container_port_number
            - action: keep
              regex: true
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_scrape_slow
            - action: replace
              regex: (https?)
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_scheme
              target_label: __scheme__
            - action: replace
              regex: (.+)
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_path
              target_label: __metrics_path__
            - action: replace
              regex: ([^:]+)(?::\d+)?;(\d+)
              replacement: $1:$2
              source_labels:
                - __address__
                - __meta_kubernetes_service_annotation_prometheus_io_port
              target_label: __address__
            - action: labelmap
              regex: __meta_kubernetes_service_label_(.+)
            - action: replace
              source_labels:
                - __meta_kubernetes_namespace
              target_label: namespace
            - action: replace
              source_labels:
                - __meta_kubernetes_service_name
              target_label: service
            - action: replace
              source_labels:
                - __meta_kubernetes_pod_node_name
              target_label: node
          scrape_interval: 5m
          scrape_timeout: 30s
        - job_name: kubernetes-services
          kubernetes_sd_configs:
            - role: service
          metrics_path: /probe
          params:
            module:
                - http_2xx
          relabel_configs:
            - action: keep
              regex: true
              source_labels:
                - __meta_kubernetes_service_annotation_prometheus_io_probe
            - source_labels:
                - __address__
              target_label: __param_target
            - replacement: blackbox
              target_label: __address__
            - source_labels:
                - __param_target
              target_label: instance
            - action: labelmap
              regex: __meta_kubernetes_service_label_(.+)
            - source_labels:
                - __meta_kubernetes_namespace
              target_label: namespace
            - source_labels:
                - __meta_kubernetes_service_name
              target_label: service
        - job_name: kubernetes-pods
          kubernetes_sd_configs:
            - role: pod
          relabel_configs:
            - action: drop
              regex: true
              source_labels:
                - __meta_kubernetes_pod_container_init
            - action: keep_if_equal
              source_labels:
                - __meta_kubernetes_pod_annotation_prometheus_io_port
                - __meta_kubernetes_pod_container_port_number
            - action: keep
              regex: true
              source_labels:
                - __meta_kubernetes_pod_annotation_prometheus_io_scrape
            - action: replace
              regex: (.+)
              source_labels:
                - __meta_kubernetes_pod_annotation_prometheus_io_path
              target_label: __metrics_path__
            - action: replace
              regex: ([^:]+)(?::\d+)?;(\d+)
              replacement: $1:$2
              source_labels:
                - __address__
                - __meta_kubernetes_pod_annotation_prometheus_io_port
              target_label: __address__
            - action: labelmap
              regex: __meta_kubernetes_pod_label_(.+)
            - action: replace
              source_labels:
                - __meta_kubernetes_namespace
              target_label: namespace
            - action: replace
              source_labels:
                - __meta_kubernetes_pod_name
              target_label: pod
configMap: ""
enabled: false
extraScrapeConfigs: []

Scrape configuration for victoriametrics

server.scrape.config object
global:
    scrape_interval: 15s
scrape_configs:
    - job_name: victoriametrics
      static_configs:
        - targets:
            - localhost:8428
    - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      job_name: kubernetes-apiservers
      kubernetes_sd_configs:
        - role: endpoints
      relabel_configs:
        - action: keep
          regex: default;kubernetes;https
          source_labels:
            - __meta_kubernetes_namespace
            - __meta_kubernetes_service_name
            - __meta_kubernetes_endpoint_port_name
      scheme: https
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
    - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      job_name: kubernetes-nodes
      kubernetes_sd_configs:
        - role: node
      relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - replacement: kubernetes.default.svc:443
          target_label: __address__
        - regex: (.+)
          replacement: /api/v1/nodes/$1/proxy/metrics
          source_labels:
            - __meta_kubernetes_node_name
          target_label: __metrics_path__
      scheme: https
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
    - bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
      honor_timestamps: false
      job_name: kubernetes-nodes-cadvisor
      kubernetes_sd_configs:
        - role: node
      relabel_configs:
        - action: labelmap
          regex: __meta_kubernetes_node_label_(.+)
        - replacement: kubernetes.default.svc:443
          target_label: __address__
        - regex: (.+)
          replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
          source_labels:
            - __meta_kubernetes_node_name
          target_label: __metrics_path__
      scheme: https
      tls_config:
        ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
        insecure_skip_verify: true
    - job_name: kubernetes-service-endpoints
      kubernetes_sd_configs:
        - role: endpoints
      relabel_configs:
        - action: drop
          regex: true
          source_labels:
            - __meta_kubernetes_pod_container_init
        - action: keep_if_equal
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_port
            - __meta_kubernetes_pod_container_port_number
        - action: keep
          regex: true
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_scrape
        - action: replace
          regex: (https?)
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_scheme
          target_label: __scheme__
        - action: replace
          regex: (.+)
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_path
          target_label: __metrics_path__
        - action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          source_labels:
            - __address__
            - __meta_kubernetes_service_annotation_prometheus_io_port
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - action: replace
          source_labels:
            - __meta_kubernetes_namespace
          target_label: namespace
        - action: replace
          source_labels:
            - __meta_kubernetes_service_name
          target_label: service
        - action: replace
          source_labels:
            - __meta_kubernetes_pod_node_name
          target_label: node
    - job_name: kubernetes-service-endpoints-slow
      kubernetes_sd_configs:
        - role: endpoints
      relabel_configs:
        - action: drop
          regex: true
          source_labels:
            - __meta_kubernetes_pod_container_init
        - action: keep_if_equal
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_port
            - __meta_kubernetes_pod_container_port_number
        - action: keep
          regex: true
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_scrape_slow
        - action: replace
          regex: (https?)
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_scheme
          target_label: __scheme__
        - action: replace
          regex: (.+)
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_path
          target_label: __metrics_path__
        - action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          source_labels:
            - __address__
            - __meta_kubernetes_service_annotation_prometheus_io_port
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - action: replace
          source_labels:
            - __meta_kubernetes_namespace
          target_label: namespace
        - action: replace
          source_labels:
            - __meta_kubernetes_service_name
          target_label: service
        - action: replace
          source_labels:
            - __meta_kubernetes_pod_node_name
          target_label: node
      scrape_interval: 5m
      scrape_timeout: 30s
    - job_name: kubernetes-services
      kubernetes_sd_configs:
        - role: service
      metrics_path: /probe
      params:
        module:
            - http_2xx
      relabel_configs:
        - action: keep
          regex: true
          source_labels:
            - __meta_kubernetes_service_annotation_prometheus_io_probe
        - source_labels:
            - __address__
          target_label: __param_target
        - replacement: blackbox
          target_label: __address__
        - source_labels:
            - __param_target
          target_label: instance
        - action: labelmap
          regex: __meta_kubernetes_service_label_(.+)
        - source_labels:
            - __meta_kubernetes_namespace
          target_label: namespace
        - source_labels:
            - __meta_kubernetes_service_name
          target_label: service
    - job_name: kubernetes-pods
      kubernetes_sd_configs:
        - role: pod
      relabel_configs:
        - action: drop
          regex: true
          source_labels:
            - __meta_kubernetes_pod_container_init
        - action: keep_if_equal
          source_labels:
            - __meta_kubernetes_pod_annotation_prometheus_io_port
            - __meta_kubernetes_pod_container_port_number
        - action: keep
          regex: true
          source_labels:
            - __meta_kubernetes_pod_annotation_prometheus_io_scrape
        - action: replace
          regex: (.+)
          source_labels:
            - __meta_kubernetes_pod_annotation_prometheus_io_path
          target_label: __metrics_path__
        - action: replace
          regex: ([^:]+)(?::\d+)?;(\d+)
          replacement: $1:$2
          source_labels:
            - __address__
            - __meta_kubernetes_pod_annotation_prometheus_io_port
          target_label: __address__
        - action: labelmap
          regex: __meta_kubernetes_pod_label_(.+)
        - action: replace
          source_labels:
            - __meta_kubernetes_namespace
          target_label: namespace
        - action: replace
          source_labels:
            - __meta_kubernetes_pod_name
          target_label: pod

Scrape config

server.scrape.config.scrape_configs list
- job_name: victoriametrics
  static_configs:
    - targets:
        - localhost:8428
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  job_name: kubernetes-apiservers
  kubernetes_sd_configs:
    - role: endpoints
  relabel_configs:
    - action: keep
      regex: default;kubernetes;https
      source_labels:
        - __meta_kubernetes_namespace
        - __meta_kubernetes_service_name
        - __meta_kubernetes_endpoint_port_name
  scheme: https
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  job_name: kubernetes-nodes
  kubernetes_sd_configs:
    - role: node
  relabel_configs:
    - action: labelmap
      regex: __meta_kubernetes_node_label_(.+)
    - replacement: kubernetes.default.svc:443
      target_label: __address__
    - regex: (.+)
      replacement: /api/v1/nodes/$1/proxy/metrics
      source_labels:
        - __meta_kubernetes_node_name
      target_label: __metrics_path__
  scheme: https
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
- bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
  honor_timestamps: false
  job_name: kubernetes-nodes-cadvisor
  kubernetes_sd_configs:
    - role: node
  relabel_configs:
    - action: labelmap
      regex: __meta_kubernetes_node_label_(.+)
    - replacement: kubernetes.default.svc:443
      target_label: __address__
    - regex: (.+)
      replacement: /api/v1/nodes/$1/proxy/metrics/cadvisor
      source_labels:
        - __meta_kubernetes_node_name
      target_label: __metrics_path__
  scheme: https
  tls_config:
    ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
    insecure_skip_verify: true
- job_name: kubernetes-service-endpoints
  kubernetes_sd_configs:
    - role: endpoints
  relabel_configs:
    - action: drop
      regex: true
      source_labels:
        - __meta_kubernetes_pod_container_init
    - action: keep_if_equal
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_port
        - __meta_kubernetes_pod_container_port_number
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scrape
    - action: replace
      regex: (https?)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scheme
      target_label: __scheme__
    - action: replace
      regex: (.+)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_path
      target_label: __metrics_path__
    - action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)
      replacement: $1:$2
      source_labels:
        - __address__
        - __meta_kubernetes_service_annotation_prometheus_io_port
      target_label: __address__
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - action: replace
      source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - action: replace
      source_labels:
        - __meta_kubernetes_service_name
      target_label: service
    - action: replace
      source_labels:
        - __meta_kubernetes_pod_node_name
      target_label: node
- job_name: kubernetes-service-endpoints-slow
  kubernetes_sd_configs:
    - role: endpoints
  relabel_configs:
    - action: drop
      regex: true
      source_labels:
        - __meta_kubernetes_pod_container_init
    - action: keep_if_equal
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_port
        - __meta_kubernetes_pod_container_port_number
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scrape_slow
    - action: replace
      regex: (https?)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scheme
      target_label: __scheme__
    - action: replace
      regex: (.+)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_path
      target_label: __metrics_path__
    - action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)
      replacement: $1:$2
      source_labels:
        - __address__
        - __meta_kubernetes_service_annotation_prometheus_io_port
      target_label: __address__
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - action: replace
      source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - action: replace
      source_labels:
        - __meta_kubernetes_service_name
      target_label: service
    - action: replace
      source_labels:
        - __meta_kubernetes_pod_node_name
      target_label: node
  scrape_interval: 5m
  scrape_timeout: 30s
- job_name: kubernetes-services
  kubernetes_sd_configs:
    - role: service
  metrics_path: /probe
  params:
    module:
        - http_2xx
  relabel_configs:
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_probe
    - source_labels:
        - __address__
      target_label: __param_target
    - replacement: blackbox
      target_label: __address__
    - source_labels:
        - __param_target
      target_label: instance
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - source_labels:
        - __meta_kubernetes_service_name
      target_label: service
- job_name: kubernetes-pods
  kubernetes_sd_configs:
    - role: pod
  relabel_configs:
    - action: drop
      regex: true
      source_labels:
        - __meta_kubernetes_pod_container_init
    - action: keep_if_equal
      source_labels:
        - __meta_kubernetes_pod_annotation_prometheus_io_port
        - __meta_kubernetes_pod_container_port_number
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_pod_annotation_prometheus_io_scrape
    - action: replace
      regex: (.+)
      source_labels:
        - __meta_kubernetes_pod_annotation_prometheus_io_path
      target_label: __metrics_path__
    - action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)
      replacement: $1:$2
      source_labels:
        - __address__
        - __meta_kubernetes_pod_annotation_prometheus_io_port
      target_label: __address__
    - action: labelmap
      regex: __meta_kubernetes_pod_label_(.+)
    - action: replace
      source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - action: replace
      source_labels:
        - __meta_kubernetes_pod_name
      target_label: pod

Scrape targets

server.scrape.config.scrape_configs[4] object
job_name: kubernetes-service-endpoints
kubernetes_sd_configs:
    - role: endpoints
relabel_configs:
    - action: drop
      regex: true
      source_labels:
        - __meta_kubernetes_pod_container_init
    - action: keep_if_equal
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_port
        - __meta_kubernetes_pod_container_port_number
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scrape
    - action: replace
      regex: (https?)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_scheme
      target_label: __scheme__
    - action: replace
      regex: (.+)
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_path
      target_label: __metrics_path__
    - action: replace
      regex: ([^:]+)(?::\d+)?;(\d+)
      replacement: $1:$2
      source_labels:
        - __address__
        - __meta_kubernetes_service_annotation_prometheus_io_port
      target_label: __address__
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - action: replace
      source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - action: replace
      source_labels:
        - __meta_kubernetes_service_name
      target_label: service
    - action: replace
      source_labels:
        - __meta_kubernetes_pod_node_name
      target_label: node

Scrape rule using kubernetes service discovery for endpoints

server.scrape.config.scrape_configs[6] object
job_name: kubernetes-services
kubernetes_sd_configs:
    - role: service
metrics_path: /probe
params:
    module:
        - http_2xx
relabel_configs:
    - action: keep
      regex: true
      source_labels:
        - __meta_kubernetes_service_annotation_prometheus_io_probe
    - source_labels:
        - __address__
      target_label: __param_target
    - replacement: blackbox
      target_label: __address__
    - source_labels:
        - __param_target
      target_label: instance
    - action: labelmap
      regex: __meta_kubernetes_service_label_(.+)
    - source_labels:
        - __meta_kubernetes_namespace
      target_label: namespace
    - source_labels:
        - __meta_kubernetes_service_name
      target_label: service

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

server.scrape.configMap string
""

Use existing configmap if specified otherwise .config values will be used. Scrape config should reside under scrape.yml key

server.scrape.enabled bool
false

If true scrapes targets, creates config map or use specified one with scrape targets

server.scrape.extraScrapeConfigs list
[]

Extra scrape configs that will be appended to server.scrape.config

server.securityContext object
enabled: true

Security context to be added to server pods

server.service.annotations object
{}

Service annotations

server.service.clusterIP string
""

Service ClusterIP

server.service.externalIPs list
[]

Service External IPs. Details are here

server.service.externalTrafficPolicy string
""
server.service.healthCheckNodePort string
""
server.service.ipFamilies list
[]
server.service.ipFamilyPolicy string
""
server.service.labels object
{}

Service labels

server.service.loadBalancerIP string
""

Service load balacner IP

server.service.loadBalancerSourceRanges list
[]

Load balancer source range

server.service.servicePort int
8428

Service port

server.service.type string
ClusterIP

Service type

server.serviceMonitor.annotations object
{}

Service Monitor annotations

server.serviceMonitor.basicAuth object
{}

Basic auth params for Service Monitor

server.serviceMonitor.enabled bool
false

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

server.serviceMonitor.extraLabels object
{}

Service Monitor labels

server.serviceMonitor.metricRelabelings list
[]

Service Monitor metricRelabelings

server.serviceMonitor.relabelings list
[]

Service Monitor relabelings

server.statefulSet.enabled bool
true

Creates statefulset instead of deployment, useful when you want to keep the cache

server.statefulSet.podManagementPolicy string
OrderedReady

Deploy order policy for StatefulSet pods

server.terminationGracePeriodSeconds int
60

Pods termination grace period in seconds

server.tolerations list
[]

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

server.vmbackupmanager.destination string
""

backup destination at S3, GCS or local filesystem. Release name will be included to path!

server.vmbackupmanager.disableDaily bool
false

disable daily backups

server.vmbackupmanager.disableHourly bool
false

disable hourly backups

server.vmbackupmanager.disableMonthly bool
false

disable monthly backups

server.vmbackupmanager.disableWeekly bool
false

disable weekly backups

server.vmbackupmanager.enabled bool
false

enable automatic creation of backup via vmbackupmanager. vmbackupmanager is part of Enterprise packages

server.vmbackupmanager.env list
[]

Additional environment variables (ex.: secret tokens, flags) https://docs.victoriametrics.com/#environment-variables

server.vmbackupmanager.extraArgs."envflag.enable" string
"true"
server.vmbackupmanager.extraArgs."envflag.prefix" string
VM_
server.vmbackupmanager.extraArgs.loggerFormat string
json
server.vmbackupmanager.extraVolumeMounts list
[]
server.vmbackupmanager.image.registry string
""

vmbackupmanager image registry

server.vmbackupmanager.image.repository string
victoriametrics/vmbackupmanager

vmbackupmanager image repository

server.vmbackupmanager.image.tag string
""

vmbackupmanager image tag

server.vmbackupmanager.image.variant string
""
server.vmbackupmanager.probe.liveness.failureThreshold int
10
server.vmbackupmanager.probe.liveness.initialDelaySeconds int
30
server.vmbackupmanager.probe.liveness.periodSeconds int
30
server.vmbackupmanager.probe.liveness.tcpSocket.port string
manager-http
server.vmbackupmanager.probe.liveness.timeoutSeconds int
5
server.vmbackupmanager.probe.readiness.failureThreshold int
3
server.vmbackupmanager.probe.readiness.httpGet.port string
manager-http
server.vmbackupmanager.probe.readiness.initialDelaySeconds int
5
server.vmbackupmanager.probe.readiness.periodSeconds int
15
server.vmbackupmanager.probe.readiness.timeoutSeconds int
5
server.vmbackupmanager.probe.startup.httpGet.port string
manager-http
server.vmbackupmanager.resources object
{}
server.vmbackupmanager.restore object
onStart:
    enabled: false

Allows to enable restore options for pod. Read more: https://docs.victoriametrics.com/vmbackupmanager#restore-commands

server.vmbackupmanager.retention object
keepLastDaily: 2
keepLastHourly: 2
keepLastMonthly: 2
keepLastWeekly: 2

backups retention settings

server.vmbackupmanager.retention.keepLastDaily int
2

keep last N daily backups. 0 means delete all existing daily backups. Specify -1 to turn off

server.vmbackupmanager.retention.keepLastHourly int
2

keep last N hourly backups. 0 means delete all existing hourly backups. Specify -1 to turn off

server.vmbackupmanager.retention.keepLastMonthly int
2

keep last N monthly backups. 0 means delete all existing monthly backups. Specify -1 to turn off

server.vmbackupmanager.retention.keepLastWeekly int
2

keep last N weekly backups. 0 means delete all existing weekly backups. Specify -1 to turn off

serviceAccount.automountToken bool
true

Mount API token to pod directly

serviceAccount.create bool
true

Create service account.

serviceAccount.extraLabels object
{}