2023-10-02 12:50:08 +00:00
---
sort: 2
weight: 2
title: Setup
2023-10-05 10:43:28 +00:00
menu:
docs:
parent: "operator"
weight: 2
2023-11-22 11:59:07 +00:00
aliases:
- /operator/setup.html
2023-10-02 12:50:08 +00:00
---
# VictoriaMetrics Operator Setup
## Installing by helm-charts
You can use one of the following official helm-charts with `vmoperator` :
- [victoria-metrics-operator helm-chart ](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-operator/README.md )
- [victoria-metrics-k8s-stack helm chart ](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/README.md )
(includes the `victoria-metrics-operator` helm-chart and other components for full-fledged k8s monitoring, is an alternative for [kube-prometheus-stack ](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-prometheus-stack )).
For installing VictoriaMetrics operator with helm-chart follow the instructions from README of the corresponding helm-chart
([this](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-operator/README.md)
or [this ](https://github.com/VictoriaMetrics/helm-charts/blob/master/charts/victoria-metrics-k8s-stack/README.md )).
in addition, you can use [quickstart guide ](./quick-start.md ) for
installing VictoriaMetrics operator with helm-chart.
## Installing by Kustomize
You can install operator using [Kustomize ](https://kustomize.io/ ) by pointing to the remote kustomization file.
2024-01-27 18:29:11 +00:00
```sh
2023-10-02 12:50:08 +00:00
# Get latest release version from https://github.com/VictoriaMetrics/operator/releases/latest
export VM_VERSION=`basename $(curl -fs -o/dev/null -w %{redirect_url} https://github.com/VictoriaMetrics/operator/releases/latest)`
2024-07-10 14:04:30 +00:00
export NAMESPACE="whatever-namespace"
2023-10-02 12:50:08 +00:00
cat < < EOF > kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/VictoriaMetrics/operator/config/default?ref=${VM_VERSION}
2024-07-10 14:04:30 +00:00
namespace: ${NAMESPACE}
2023-10-02 12:50:08 +00:00
images:
- name: victoriametrics/operator
newTag: ${VM_VERSION}
EOF
```
You can change [operator configuration ](#configuring ), or use your custom namespace see [kustomize-example ](https://github.com/YuriKravetc/yurikravetc.github.io/tree/main/Operator/kustomize-example ).
Build template
2024-01-27 18:29:11 +00:00
```sh
2023-10-02 12:50:08 +00:00
kustomize build . -o monitoring.yaml
```
Apply manifests
2024-01-27 18:29:11 +00:00
```sh
2023-10-02 12:50:08 +00:00
kubectl apply -f monitoring.yaml
```
Check the status of operator
2024-01-27 18:29:11 +00:00
```sh
2024-07-10 14:04:30 +00:00
kubectl get pods -n whatever-namespace
2023-10-02 12:50:08 +00:00
#NAME READY STATUS RESTARTS AGE
#vm-operator-667dfbff55-cbvkf 1/1 Running 0 101s
```
2024-07-10 14:04:30 +00:00
## Installing by OLM
### Installing to K8s
TODO
### Installing to Openshift
TODO
### Run locally
It's possible to build and run OLM package locally on Kind K8s cluster using `make deploy-kind-olm` .
Command builds operator image, bundle and index images, runs Kind with a local registry and deploys OLM package to Kind.
2023-10-02 12:50:08 +00:00
## Installing to ARM
There is no need in an additional configuration for ARM. Operator and VictoriaMetrics have full support for it.
## Configuring
You can read detailed instructions about operator configuring in [this document ](./configuration.md ).