Victoria Metrics Operator
Prerequisites #
- Install the follow packages:
git
,kubectl
,helm
,helm-docs
. See this tutorial. - PV support on underlying infrastructure.
ArgoCD issues #
When running operator using ArgoCD without Cert Manager (.Values.admissionWebhooks.certManager.enabled: false
) it will rerender webhook certificates
on each sync since Helm lookup
function is not respected by ArgoCD. To prevent this please update you operator Application spec.syncPolicy
and spec.ignoreDifferences
with a following:
|
|
where <fullname>
is output of {{ include "vm-operator.fullname" }}
for your setup
Upgrade guide #
During release an issue with helm CRD was discovered. So for upgrade from version less then 0.1.3 you have to two options:
- use helm management for CRD, enabled by default.
- use own management system, need to add variable: –set createCRD=false.
If you choose helm management, following steps must be done before upgrade:
- define namespace and helm release name variables
|
|
execute kubectl commands:
|
|
run helm upgrade command.
Chart Details #
This chart will do the following:
- Rollout victoria metrics operator
How to install #
Access a Kubernetes cluster.
Setup chart repository (can be omitted for OCI repositories) #
Add a chart helm repository with follow commands:
|
|
List versions of vm/victoria-metrics-operator
chart available to installation:
|
|
Install victoria-metrics-operator
chart
#
Export default values of victoria-metrics-operator
chart to file values.yaml
:
For HTTPS repository
1 2
helm show values vm/victoria-metrics-operator > values.yaml
For OCI repository
1 2
helm show values oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-operator > values.yaml
Change the values according to the need of the environment in values.yaml
file.
Test the installation with command:
For HTTPS repository
1 2
helm install vmo vm/victoria-metrics-operator -f values.yaml -n NAMESPACE --debug --dry-run
For OCI repository
1 2
helm install vmo oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-operator -f values.yaml -n NAMESPACE --debug --dry-run
Install chart with command:
For HTTPS repository
1 2
helm install vmo vm/victoria-metrics-operator -f values.yaml -n NAMESPACE
For OCI repository
1 2
helm install vmo oci://ghcr.io/victoriametrics/helm-charts/victoria-metrics-operator -f values.yaml -n NAMESPACE
Get the pods lists by running this commands:
|
|
Get the application by running this command:
|
|
See the history of versions of vmo
application with command.
|
|
Validation webhook #
Its possible to use validation of created resources with operator. For now, you need cert-manager to easily certificate management https://cert-manager.io/docs/
|
|
How to uninstall #
Remove application with command.
|
|
Documentation of Helm Chart #
Install helm-docs
following the instructions on this tutorial.
Generate docs with helm-docs
command.
|
|
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.
Disabling automatic ServiceAccount token mount #
There are cases when it is required to disable automatic ServiceAccount token mount due to hardening reasons. To disable it, set the following values:
|
|
This configuration disables the automatic ServiceAccount token mount and mounts the token explicitly.
Enable hostNetwork on operator #
When running managed Kubernetes such as EKS with custom CNI solution like Cilium or Calico, EKS control plane cannot communicate with CNI’s pod CIDR. In that scenario, we need to run webhook service i.e operator with hostNetwork so that it can share node’s network namespace.
|
|
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-operator/values.yaml
file.
Key | Description |
---|---|
| (object) Configures resource validation |
| (object) Enables custom ca bundle, if you are not using cert-manager. In case of custom ca, you have to create secret - {chart-name}-validation with keys: tls.key, tls.crt, ca.crt |
| (object) Certificate Authority parameters |
| (object) Certificate parameters |
| (bool) Enables cert creation and injection by cert-manager. |
| (object) If needed, provide own issuer. Operator will create self-signed if empty. |
| (bool) Enables validation webhook. |
| (string) What to do in case, when operator not available to validate request. |
| (object) Pod affinity |
| (string) |
| (string) |
| (object) Annotations to be added to the all resources |
| (object) additional CRD annotations, when |
| (bool) Tells helm to clean up all the vm resources under this release’s namespace when uninstalling |
| (object) Image configuration for CRD cleanup Job |
| (object) Cleanup hook resources |
| (bool) manages CRD creation. Disables CRD creation only in combination with |
| (bool) check if plain or templated CRDs should be created. with this option set to |
| (list) Extra settings for the operator deployment. Full list here |
| (list) Specify alternative source for env variables |
| (object) Operator container additional commandline arguments |
| (list) Extra containers to run in a pod with operator |
| (list) Additional hostPath mounts |
| (object) Labels to be added to the all resources |
| (list) Add extra specs dynamically to this chart |
| (list) Extra Volume Mounts for the container |
| (list) Extra Volumes for the pod |
| (string) Overrides the full name of server component resources |
| (string) K8s cluster domain suffix, uses for building storage pods’ FQDN. Details are here |
| (object) Openshift security context compatibility configuration |
| (string) Image registry, that can be shared across multiple helm charts |
| (list) Image pull secrets, that can be shared across multiple helm charts |
| (bool) Enable hostNetwork on operator deployment |
| (object) operator image configuration |
| (string) Image pull policy |
| (string) Image registry |
| (string) Image repository |
| (string) Image tag override Chart.AppVersion |
| (list) Secret to pull images |
| (object) Operator lifecycle. See this article for details. |
| (string) VM operator log level. Possible values: info and error. |
| (string) Override chart name |
| (object) Pod’s node selector. Details are here |
| (bool) By default, operator converts prometheus-operator objects. |
| (bool) Enables ownership reference for converted prometheus-operator objects, it will remove corresponding victoria-metrics objects in case of deletion prometheus one. |
| (bool) Compare-options and sync-options for prometheus objects converted by operator for properly use with ArgoCD |
| (bool) Enables custom config-reloader, bundled with operator. It should reduce vmagent and vmauth config sync-time and make it predictable. |
| (object) See |
| (object) extra Labels for Pods only |
| (object) Pod’s security context. Details are here |
| (string) Name of Priority Class |
| (object) Liveness probe |
| (object) Readiness probe |
| (object) Startup probe |
| (object) Create aggregated clusterRoles for CRD readonly and admin permissions |
| (object) Labels attached to according clusterRole |
| (bool) Specifies whether the RBAC resources should be created |
| (int) Number of operator replicas |
| (object) Resource object |
| (object) Security context to be added to server pods |
| (object) Service annotations |
| (string) Service ClusterIP |
| (string) Service external IPs. Check here for details |
| (string) Service external traffic policy. Check here for details |
| (string) Health check node port for a service. Check here for details |
| (list) List of service IP families. Check here for details. |
| (string) Service IP family policy. Check here for details. |
| (object) Service labels |
| (string) Service load balancer IP |
| (list) Load balancer source range |
| (int) Service port |
| (string) Service type |
| (int) Service webhook port |
| (bool) Whether to automount the service account token. Note that token needs to be mounted manually if this is disabled. |
| (bool) Specifies whether a service account should be created |
| (string) The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
| (object) Configures monitoring with serviceScrape using either |
| (bool) Creates |
| (int) Graceful pod termination timeout. See this article for details. |
| (list) Array of tolerations object. Spec is here |
| (list) Pod Topology Spread Constraints. Spec is here |
| (list) By default, the operator will watch all the namespaces If you want to override this behavior, specify the namespace. Operator supports multiple namespaces for watching. |