VictoriaMetrics Operator serves to make running VictoriaMetrics applications on top of Kubernetes as easy as possible while preserving Kubernetes-native configuration options.
The shortest way to deploy full-stack monitoring cluster with VictoriaMetrics Operator is to use Helm-chart victoria-metrics-k8s-stack.
Also you can follow the other steps in documentation to use VictoriaMetrics Operator:
- Setup
- Security
- Configuration
- Migration from Prometheus
- Monitoring
- Authorization and exposing components
- High Availability
- Enterprise
- Custom resources
- FAQ (Frequency Asked Questions)
But if you want to deploy VictoriaMetrics Operator quickly from scratch (without using templating for custom resources), you can follow this guide:
Let’s start!
Setup operator #
You can find out how to and instructions for installing the VictoriaMetrics operator into your kubernetes cluster on the Setup page.
Here we will elaborate on just one of the ways - for instance, we will install operator via Helm-chart victoria-metrics-operator:
Add repo with helm-chart:
Render values.yaml
with default operator configuration:
Now you can configure operator - open rendered values.yaml
file in your text editor. For example:

Now you can change configuration in values.yaml
. For more details about configuration options and methods,
see configuration -> victoria-metrics-operator.
If you migrated from prometheus-operator, you can read about prometheus-operator objects conversion on the migration from prometheus-operator.
Since we’re looking at installing from scratch, let’s disable prometheus-operator objects conversion,
and also let’s set some resources for operator in values.yaml
:
You will need a kubernetes namespace to deploy the operator and VM components. Let’s create it:
After finishing with values.yaml
and creating namespace, you can test the installation with command:
Where vm
is the namespace where you want to install operator.
If everything is ok, you can install operator with command:
And check that operator is running:
Deploy components #
Now you can create instances of VictoriaMetrics applications.
Let’s create fullstack monitoring cluster with
vmagent
,
vmauth
,
vmalert
,
vmalertmanager
,vmcluster
(a component for deploying a cluster version of
VictoriaMetrics
consisting of vmstorage
, vmselect
and vminsert
):

More details about resources of VictoriaMetrics operator you can find on the resources page.
VMCluster (vmselect, vminsert, vmstorage) #
Let’s start by deploying the vmcluster
resource.
Create file vmcluster.yaml
with the following content:
After that you can deploy vmcluster
resource to the kubernetes cluster:
Check that vmcluster
is running:
Now you can see that 6 components of your demo vmcluster is running.
In addition, you can see that the operator created services for each of the component type:
We’ll need them in the next steps.
More information about vmcluster
resource you can find on
the vmcluster page.
Scraping #
VMAgent #
Now let’s deploy vmagent
resource.
Create file vmagent.yaml
with the following content:
After that you can deploy vmagent
resource to the kubernetes cluster:
Check that vmagent
is running:
More information about vmagent
resource you can find on
the vmagent page.
VMServiceScrape #
Now we have the timeseries database (vmcluster) and the tool to collect metrics (vmagent) and send it to the database.
But we need to tell vmagent what metrics to collect. For this we will use vmservicescrape
resource
or other *scrape
resources.
By default, operator creates vmservicescrape
resource for each component that it manages. More details about this you can find on
the monitoring page.
For instance, we can create vmservicescrape
for VictoriaMetrics operator manually. Let’s create file vmservicescrape.yaml
:
with the following content:
After that you can deploy vmservicescrape
resource to the kubernetes cluster:
Access #
We need to look at the results of what we got. Up until now, we’ve just been looking only at the status of the pods.
VMAuth #
Let’s expose our components with vmauth
.
Create file vmauth.yaml
with the following content:
Note that content of ingress
field depends on your ingress-controller and domain.
Your cluster will have them differently.
Also, for simplicity, we don’t use tls, but in real environments not having tls is unsafe.
VMUser #
To get authorized access to our data it is necessary to create a user using the vmuser resource.
Create file vmuser.yaml
with the following content:
After that you can deploy vmauth
and vmuser
resources to the kubernetes cluster:
Operator automatically creates a secret with username/password token for VMUser
resource with generatePassword=true
:
You can get password for your user with command:
Now you can get access to your data with url http://vm-demo.k8s.orb.local/vmui
, username demo
and your given password (Yt3N2r3cPl
in our case):


Alerting #
The remaining components will be needed for alerting.
VMAlertmanager #
Let’s start with vmalertmanager
.
Create file vmalertmanager.yaml
with the following content:
where webhook-url is the address of the webhook to receive notifications
(configuration of AlertManager notifications will remain out of scope).
You can find more details about alertmanager
configuration in
the Alertmanager documentation.
After that you can deploy vmalertmanager
resource to the kubernetes cluster:
Check that vmalertmanager
is running:
VMAlert #
And now you can create vmalert
resource.
Create file vmalert.yaml
with the following content:
After that you can deploy vmalert
resource to the kubernetes cluster:
Check that vmalert
is running:
VMRule #
Now you can create vmrule resource for vmalert.
Create file vmrule.yaml
with the following content:
After that you can deploy vmrule
resource to the kubernetes cluster:
VMUser update #
Let’s update our user with access to vmalert
and vmalertmanager
:
After that you can deploy vmuser
resource to the kubernetes cluster:
And now you can get access to your data with url http://vm-demo.k8s.orb.local/vmalert
(for your environment it most likely will be different) with username demo
:


Anything else #
That’s it. We obtained a monitoring cluster corresponding to the target topology:

You have a full-stack monitoring cluster with VictoriaMetrics Operator.
You can find information about these and other resources of operator on the Custom resources page.
In addition, check out other sections of the documentation for VictoriaMetrics Operator:
- Setup
- Security
- Configuration
- Migration from Prometheus
- Monitoring
- Authorization and exposing components
- High Availability
- Enterprise
If you have any questions, check out our FAQ and feel free to can ask them:
If you have any suggestions or find a bug, please create an issue on GitHub.