# victoria-metrics-cluster

VictoriaMetrics cluster: vmstorage, vmselect and vminsert through a VMCluster CR

This page is generated from [`kix/packages/stable/victoria-metrics-cluster`](https://github.com/kix-run/kix/tree/main/kix/packages/stable/victoria-metrics-cluster).

| | |
| --- | --- |
| Stability | Stable |
| `package` value | `packages.victoria-metrics-cluster` |
| Default software version | `1.156.0` |
| Default aliases | `prometheusServer`, `vmCluster` |

## How-to guides

- [Install the VictoriaMetrics HA monitoring stack](/docs/how-to/package-task-guides/install-the-victoriametrics-ha-monitoring-stack/)

## Dependencies

Kix matches each dependency below to another package instance by instance name, alias, or role. To bind a specific instance, set [`deps.<name>`](/docs/reference/instances-and-composition/#deps) in your cluster definition. See [Declaring dependencies](/docs/reference/package-anatomy/#declaring-dependencies) for how required and optional dependencies work.

| Dependency | Requirement |
| --- | --- |
| `vmOperator` | Required |
| `prometheus` | Optional |
| `storageClasses` | Optional |

## Options

### `clusterVersion`

Image tag for all three components (spec.clusterVersion, used
verbatim by the operator). Cluster-mode images carry the
`-cluster` suffix.

- **Type:** `string`
- **Default:** `"v1.156.0-cluster"`

### `extraSpec`

Extra fields deep-merged into the VMCluster CR spec via
lib.recursiveUpdate. Escape hatch for fields not exposed as typed
options (downsampling, requestsLoadBalancer, per-component
overrides). Setting `topologySpreadConstraints` on `vmstorage`,
`vmselect`, or `vminsert` here replaces the default pod spread
constraints set from the availability level.

- **Type:** `attribute set of anything`
- **Default:** `{ }`

### `metrics.enabled`

Render the package's alert rules when a `prometheus` dependency is present. The operator's scrape of the workload does not depend on it.

- **Type:** `boolean`
- **Default:** `true`

### `metrics.minFreeDiskPercent`

VMStorageDiskNearlyFull fires when a vmstorage node has less than this percentage of its usable disk left, where usable is the stored data plus the free space above -storage.minFreeDiskSpaceBytes. Below that limit the node turns read-only. The default follows upstream's DiskRunsOutOfSpace rule (80% used).

- **Type:** `integer between 1 and 99 (both inclusive)`
- **Default:** `20`

### `replicationFactor`

Copies of every sample across vmstorage nodes. The operator
propagates it to vminsert and vmselect (-replicationFactor), so
queries stay complete with one vmstorage down. Defaults from the
cluster's availability level.

- **Type:** `signed integer`
- **Default:** `1`

### `retentionPeriod`

- **Type:** `string`
- **Default:** `"30d"`

### `scrapeInterval`

Drives -dedup.minScrapeInterval on vmselect and vmstorage.
Scrapers (victoria-metrics-agent) must scrape at this interval;
read it via out.scrapeInterval.

- **Type:** `string`
- **Default:** `"30s"`

### `useStrictSecurity`

Operator-applied hardened security contexts on operand pods.

- **Type:** `boolean`
- **Default:** `true`

### `vminsert.extraArgs`

Extra vminsert flags, keyed by flag name without the leading dash. The package refuses `retentionPeriod` and `replicationFactor`, which follow the options of the same name, and `httpListenAddr`, because `out.remoteWriteUrl` names port 8480.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `vminsert.replicaCount`

Number of vminsert replicas. Defaults from the cluster's
availability level.

- **Type:** `signed integer`
- **Default:** `1`

### `vminsert.resources`

Container resource requests and limits. Each field keeps its default until set, and null removes a default.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    limits = {
      memory = "1Gi";
    };
    requests = {
      cpu = "500m";
      memory = "512Mi";
    };
  }
  ```

### `vminsert.resources.claims`

Dynamic resource claims the container uses. Null leaves it unset.

- **Type:** `null or (list of (submodule))`
- **Default:** `null`

### `vminsert.resources.claims.*.name`

Name of an entry in the pod's `resourceClaims`.

- **Type:** `string`

### `vminsert.resources.claims.*.request`

Request within the claim to use. Null uses the whole claim.

- **Type:** `null or string`
- **Default:** `null`

### `vminsert.resources.limits`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vminsert.resources.limits.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vminsert.resources.limits.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vminsert.resources.limits.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"1Gi"`

### `vminsert.resources.requests`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vminsert.resources.requests.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"500m"`

### `vminsert.resources.requests.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vminsert.resources.requests.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"512Mi"`

### `vmselect.extraArgs`

Extra vmselect flags, keyed by flag name without the leading dash. The package refuses `dedup.minScrapeInterval`, `retentionPeriod`, and `replicationFactor`, which follow `scrapeInterval`, `retentionPeriod`, and `replicationFactor`, and `httpListenAddr`, because `out.serviceUrl` names port 8481.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `vmselect.replicaCount`

Number of vmselect replicas. Defaults from the cluster's
availability level.

- **Type:** `signed integer`
- **Default:** `1`

### `vmselect.resources`

Container resource requests and limits. Each field keeps its default until set, and null removes a default.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    limits = {
      memory = "1Gi";
    };
    requests = {
      cpu = "500m";
      memory = "512Mi";
    };
  }
  ```

### `vmselect.resources.claims`

Dynamic resource claims the container uses. Null leaves it unset.

- **Type:** `null or (list of (submodule))`
- **Default:** `null`

### `vmselect.resources.claims.*.name`

Name of an entry in the pod's `resourceClaims`.

- **Type:** `string`

### `vmselect.resources.claims.*.request`

Request within the claim to use. Null uses the whole claim.

- **Type:** `null or string`
- **Default:** `null`

### `vmselect.resources.limits`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vmselect.resources.limits.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmselect.resources.limits.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmselect.resources.limits.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"1Gi"`

### `vmselect.resources.requests`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vmselect.resources.requests.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"500m"`

### `vmselect.resources.requests.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmselect.resources.requests.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"512Mi"`

### `vmstorage.extraArgs`

Extra vmstorage flags, keyed by flag name without the leading dash. The package refuses `dedup.minScrapeInterval`, `retentionPeriod`, and `replicationFactor`, which follow `scrapeInterval`, `retentionPeriod`, and `replicationFactor`.

- **Type:** `attribute set of string`
- **Default:** `{ }`

### `vmstorage.replicaCount`

Minimum 3 for replicationFactor 2 with one-node failure
headroom. Defaults from the cluster's availability level.

- **Type:** `signed integer`
- **Default:** `1`

### `vmstorage.resources`

Container resource requests and limits. Each field keeps its default until set, and null removes a default.

- **Type:** `submodule`
- **Default:**

  ```nix
  {
    limits = {
      memory = "4Gi";
    };
    requests = {
      cpu = "1";
      memory = "2Gi";
    };
  }
  ```

### `vmstorage.resources.claims`

Dynamic resource claims the container uses. Null leaves it unset.

- **Type:** `null or (list of (submodule))`
- **Default:** `null`

### `vmstorage.resources.claims.*.name`

Name of an entry in the pod's `resourceClaims`.

- **Type:** `string`

### `vmstorage.resources.claims.*.request`

Request within the claim to use. Null uses the whole claim.

- **Type:** `null or string`
- **Default:** `null`

### `vmstorage.resources.limits`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vmstorage.resources.limits.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmstorage.resources.limits.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmstorage.resources.limits.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"4Gi"`

### `vmstorage.resources.requests`

Resource quantities by name.

- **Type:** `open submodule of attribute set of Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `{ }`

### `vmstorage.resources.requests.cpu`

The cpu quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"1"`

### `vmstorage.resources.requests.ephemeral-storage`

The ephemeral-storage quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `null`

### `vmstorage.resources.requests.memory`

The memory quantity. Null leaves it unset.

- **Type:** `null or Kubernetes quantity, such as "500m" or "1Gi" (a non-negative decimal or integer with an optional suffix m, k, M, G, T, P, E, Ki, Mi, Gi, Ti, Pi or Ei)`
- **Default:** `"2Gi"`

### `vmstorage.storage`

PersistentVolumeClaim spec for the vmstorage volumeClaimTemplate (operator-created claims). Deep-merged over the package's spec, which requests 20Gi. `storageClassName` is refused here; set `vmstorage.storageClassName`.

- **Type:** `attribute set of anything`
- **Default:** `{ resources.requests.storage = "20Gi"; }`

### `vmstorage.storageClassName`

StorageClass for vmstorage claims. null = take it from the
optional storageClasses dep, or fall back to the cluster
default StorageClass.

- **Type:** `null or string`
- **Default:** `null`