VictoriaMetrics/docs/operator/setup.md
Github Actions c57e68a0cd
Automatic update operator docs from VictoriaMetrics/operator@64879fb (#6831)
Automated changes by
[create-pull-request](https://github.com/peter-evans/create-pull-request)
GitHub action

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: f41gh7 <nik@victoriametrics.com>
(cherry picked from commit 015f0b0424)
2024-08-19 17:45:40 +02:00

4.8 KiB

weight title menu aliases
2 Setup
docs
parent weight
operator 2
/operator/setup/
/operator/setup/index.html

Installing by helm-charts

You can use one of the following official helm-charts with vmoperator:

For installing VictoriaMetrics operator with helm-chart follow the instructions from README of the corresponding helm-chart (this or this).

in addition, you can use quickstart guide for installing VictoriaMetrics operator with helm-chart.

Installing by Manifest

Obtain release from releases page: https://github.com/VictoriaMetrics/operator/releases

We suggest use the latest release.

# 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)`
wget https://github.com/VictoriaMetrics/operator/releases/download/$VM_VERSION/install.yaml

Operator use vm namespace, but you can install it to specific namespace with command:

sed -i "s/namespace: vm/namespace: YOUR_NAMESPACE/g" install.yaml

and apply it:

kubectl apply -f install.yaml

Check the status of operator

kubectl get pods -n YOUR_NAMESPACE

#NAME                           READY   STATUS    RESTARTS   AGE
#vm-operator-667dfbff55-cbvkf   1/1     Running   0          101s

Installing by Kustomize

You can install operator using Kustomize by pointing to the remote kustomization file.

# 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)`
export NAMESPACE="whatever-namespace"

cat << EOF > kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- github.com/VictoriaMetrics/operator/config/base?ref=${VM_VERSION}

namespace: ${NAMESPACE}

images:
- name: victoriametrics/operator
  newTag: ${VM_VERSION}
EOF

You can change operator configuration, or use your custom namespace see kustomize-example.

Build template

kustomize build . -o monitoring.yaml

Apply manifests

kubectl apply -f monitoring.yaml

Check the status of operator

kubectl get pods -n whatever-namespace

#NAME                           READY   STATUS    RESTARTS   AGE
#vm-operator-667dfbff55-cbvkf   1/1     Running   0          101s

Installing by OLM

Installing to K8s

VictoriaMetrics operator OLM package is available at OperatorHub. Installation instructions are available there.

Installing to Openshift

Create Subscription manifest with installPlanApproval set to Manual to prevent unexpected upgrades.

apiVersion: operators.coreos.com/v1alpha1
kind: Subscription
metadata:
  name: victoriametrics-operator
  namespace: vm
spec:
  channel: beta
  installPlanApproval: Manual
  name: victoriametrics-operator
  source: community-operators
  sourceNamespace: openshift-marketplace
  startingCSV: victoriametrics-operator.v0.46.4

Apply manifest

oc apply -f manifest.yaml

After some time operator should be up and running in vm namespace

oc get pods -n vm

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.

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.