Project: VictoriaMetrics (Observability and Analysis / Observability)
File: configuration.md

sort: 4 weight: 4 title: Configuration menu: docs: parent: "operator" weight: 4 aliases: /operator/configuration.html Operator configured by env variables, list of it can be found on 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: ```sh ./operator --printDefaults ``` You can choose output format for variables with `--printFormat` flag, possible values: `json`, `yaml`, `list` and `table` (default): ```sh .operator --printDefaults --printFormat=json ``` You can read detailed instructions about configuring prometheus-objects conversion in . In some important configuration parameters are implemented as separate flags in `values.yaml`: For possible values refer to . Also, checkout to configure operator behaviour. ENV variables can be set in the `victoria-metrics-operator.env` section. ```yaml victoria-metrics-operator: image: repository: victoriametrics/operator tag: v0.35.0 pullPolicy: IfNotPresent cleanupCRD: true cleanupImage: repository: gcr.io/google_containers/hyperkube tag: v1.18.0 pullPolicy: IfNotPresent operator: disableprometheusconverter: false prometheusconverteraddargocdignore_annotations: false enableconverterownership: false pspautocreation_enabled: true useCustomConfigReloader: false env: name: VMVMSINGLEDEFAULTVERSION value: v1.43.0 name: VM_CONTAINERREGISTRY value: "" name: VM_CUSTOMCONFIGRELOADERIMAGE value: victoriametrics/operator:config-reloader-v0.32.0 watchNamespace: "" replicaCount: 1 logLevel: "info" resources: {} ``` For possible values refer to . Also, checkout to configure operator behaviour. ENV variables can be set in the `env` section. ```yaml image: repository: victoriametrics/operator tag: v0.35.0 pullPolicy: IfNotPresent operator: disableprometheusconverter: false prometheusconverteraddargocdignore_annotations: false enableconverterownership: false pspautocreation_enabled: true useCustomConfigReloader: false env: name: VMVMSINGLEDEFAULTVERSION value: v1.43.0 name: VM_CONTAINERREGISTRY value: "" name: VM_CUSTOMCONFIGRELOADERIMAGE value: victoriametrics/operator:config-reloader-v0.32.0 watchNamespace: "" replicaCount: 1 logLevel: "info" resources: {} ``` By default, the operator will watch all namespaces, but it can be configured to watch only specific namespace or multiple namespaces. If you want to override this behavior, specify the namespace: in the `WATCH_NAMESPACE` environment variable. in the `watchNamespace` field in the `values.yaml` file of helm-charts. The operator supports comma separated namespace names for this setting. If namespaced mode is enabled, operator uses a limited set of features: it cannot make any cluster wide API calls. it cannot assign rbac permissions for `vmagent`. It must be done manually via serviceAccount for vmagent. it ignores namespaceSelector fields at CRD objects and uses `WATCH_NAMESPACE` value for object matching. At each namespace operator must have a set of required permissions, an example can be found at . By default, operator creates object for each component that it manages. You can disable this behaviour with `VM_DASABLESELFSERVICASCRAPECREATION` environment variable: ```shell VM_DASABLESELFSERVICASCRAPECREATION=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`): Operator supports validation admission webhook 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: ```sh ./operator --webhook.enable --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: ```sh kustomize build config/deployments/webhook/ ``` Valid certificate with key must be provided to operator Valid CABundle must be added to the `ValidatingWebhookConfiguration`