Operator configured by env variables, list of it can be found
on Variables page.
It defines default configuration options, like images for components, timeouts, features.
In addition, the operator has a special startup mode for outputting all variables, their types and default values.
For instance, with this mode you can know versions of VM components, which are used by default:
1
2
3
4
5
6
7
8
9
10
11
12
13
./operator --printDefaults
# This application is configured via the environment. The following environment variables can be used:# # KEY TYPE DEFAULT REQUIRED DESCRIPTION# VM_USECUSTOMCONFIGRELOADER True or False false # VM_CUSTOMCONFIGRELOADERIMAGE String victoriametrics/operator:config-reloader-v0.32.0 # VM_VMALERTDEFAULT_IMAGE String victoriametrics/vmalert # VM_VMALERTDEFAULT_VERSION String v1.93.3 # VM_VMALERTDEFAULT_USEDEFAULTRESOURCES True or False true # VM_VMALERTDEFAULT_RESOURCE_LIMIT_MEM String 500Mi # VM_VMALERTDEFAULT_RESOURCE_LIMIT_CPU String 200m # ...
You can choose output format for variables with --printFormat flag, possible values: json, yaml, list and table (default):
# values.yamlvictoria-metrics-operator:image:# -- Image repositoryrepository:victoriametrics/operator# -- Image tagtag:v0.35.0# -- Image pull policypullPolicy:IfNotPresent# -- Tells helm to remove CRD after chart removecleanupCRD:truecleanupImage:repository:gcr.io/google_containers/hyperkubetag:v1.18.0pullPolicy:IfNotPresentoperator:# -- By default, operator converts prometheus-operator objects.disable_prometheus_converter:false# -- Compare-options and sync-options for prometheus objects converted by operator for properly use with ArgoCDprometheus_converter_add_argocd_ignore_annotations:false# -- Enables ownership reference for converted prometheus-operator objects,# it will remove corresponding victoria-metrics objects in case of deletion prometheus one.enable_converter_ownership:false# -- By default, operator creates psp for its objects.psp_auto_creation_enabled:true# -- Enables custom config-reloader, bundled with operator.# It should reduce vmagent and vmauth config sync-time and make it predictable.useCustomConfigReloader:false# -- extra settings for the operator deployment. full list Ref: https://docs.victoriametrics.com/operator/varsenv:# -- default version for vmsingle- name:VM_VMSINGLEDEFAULT_VERSIONvalue:v1.43.0# -- container registry name prefix, e.g. docker.io- name:VM_CONTAINERREGISTRYvalue:""# -- image for custom reloader (see the useCustomConfigReloader parameter)- name:VM_CUSTOMCONFIGRELOADERIMAGEvalue:victoriametrics/operator:config-reloader-v0.32.0# By default, the operator will watch all the namespaces# If you want to override this behavior, specify the namespace it needs to watch separated by a comma.# Ex: my_namespace1,my_namespace2watchNamespace:""# Count of operator instances (can be increased for HA mode)replicaCount:1# -- VM operator log level# -- possible values: info and error.logLevel:"info"# -- Resource objectresources:{}# limits:# cpu: 120m# memory: 320Mi# requests:# cpu: 80m# memory: 120Mi
# values.yamlimage:# -- Image repositoryrepository:victoriametrics/operator# -- Image tagtag:v0.35.0# -- Image pull policypullPolicy:IfNotPresentoperator:# -- By default, operator converts prometheus-operator objects.disable_prometheus_converter:false# -- Compare-options and sync-options for prometheus objects converted by operator for properly use with ArgoCDprometheus_converter_add_argocd_ignore_annotations:false# -- Enables ownership reference for converted prometheus-operator objects,# it will remove corresponding victoria-metrics objects in case of deletion prometheus one.enable_converter_ownership:false# -- By default, operator creates psp for its objects.psp_auto_creation_enabled:true# -- Enables custom config-reloader, bundled with operator.# It should reduce vmagent and vmauth config sync-time and make it predictable.useCustomConfigReloader:false# -- extra settings for the operator deployment. full list Ref: https://docs.victoriametrics.com/operator/varsenv:# -- default version for vmsingle- name:VM_VMSINGLEDEFAULT_VERSIONvalue:v1.43.0# -- container registry name prefix, e.g. docker.io- name:VM_CONTAINERREGISTRYvalue:""# -- image for custom reloader (see the useCustomConfigReloader parameter)- name:VM_CUSTOMCONFIGRELOADERIMAGEvalue:victoriametrics/operator:config-reloader-v0.32.0# By default, the operator will watch all the namespaces# If you want to override this behavior, specify the namespace it needs to watch separated by a comma.# Ex: my_namespace1,my_namespace2watchNamespace:""# Count of operator instances (can be increased for HA mode)replicaCount:1# -- VM operator log level# -- possible values: info and error.logLevel:"info"# -- Resource objectresources:{}# limits:# cpu: 120m# memory: 320Mi# requests:# cpu: 80m# memory: 120Mi
By default, operator creates VMServiceScrape
object for each component that it manages.
You can disable this behaviour with VM_DISABLESELFSERVICESCRAPECREATION environment variable:
1
VM_DISABLESELFSERVICESCRAPECREATION=false
Also, you can override default configuration for self-scraping with ServiceScrapeSpec field in each deployable resource
(vmcluster/select, vmcluster/insert, vmcluster/storage, vmagent, vmalert, vmalertmanager, vmauth, vmsingle):
It checks resources configuration and returns errors to caller before resource will be created at kubernetes api.
This should reduce errors and simplify debugging.
Validation hooks at operator side must be enabled with flags:
1
2
3
4
5
6
./operator
--webhook.enable
# optional configuration for certDir and tls names. --webhook.certDir=/tmp/k8s-webhook-server/serving-certs/
--webhook.keyName=tls.key
--webhook.certName=tls.crt
You have to mount correct certificates at give directory.
It can be simplified with cert-manager and kustomize command: