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)`

# Download manifest with webhook (requires CertManager to be preinstalled)
wget -O install.yaml https://github.com/VictoriaMetrics/operator/releases/download/$VM_VERSION/install-with-webhook.yaml

# Or download manifest without webhook
wget -O install.yaml https://github.com/VictoriaMetrics/operator/releases/download/$VM_VERSION/install-no-webhook.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"

# Overlay "base-with-webhook" installs operator with webhook (requires CertManager to be preinstalled). Replace "base-with-webhook" with "default"
export OVERLAY="base-with-webhook"

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

namespace: ${NAMESPACE}

images:
- name: manager
  newName: 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 #

OLM bundles for published releases are produced by the release workflow.

Custom resource definitions #

The operator checks at startup that the CRD of every enabled controller is installed in the cluster. If a CRD is missing, the operator exits with an error that names the missing CRD.

To fix it, either:

  • install the CRDs that ship with the same operator release. Upgrade CRDs together with the operator, since new releases may add new CRDs;
  • or disable the controllers you do not use with the -controller.disableReconcileFor flag. For example, -controller.disableReconcileFor=VTAgent. Child controllers still require the CRDs of their parent objects. For example, VMServiceScrape objects are selected by VMAgent, so the VMAgent CRD must stay installed.

The operator also needs RBAC permissions for the CRD of every enabled controller: at least get, list and watch for its cache, plus write access to the objects and any status or finalizers subresources used by that controller. The RBAC rules that ship with the operator release include the permissions required by each controller.

Prometheus Operator CRDs, such as ServiceMonitor or PrometheusRule, are an exception. If they are missing, the operator disables the respective converter controllers automatically.

CPU architectures #

Both operator and VictoriaMetrics have full support for the following architectures:

  • amd64
  • arm64 (aarch64)
  • ppc64le
  • s390x

No additional configuration is required for non-standard CPU architectures.

Configuring #

You can read detailed instructions about operator configuring in this document .