# valkey

Valkey, a Redis-compatible data store: one primary, or a primary with replicas and Sentinel failover

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

| | |
| --- | --- |
| Stability | Stable |
| `package` value | `packages.valkey` |
| Default software version | `9.1.3` |
| Default aliases | `redis` |

## How-to guides

- [Deploy Valkey / Redis](/docs/how-to/package-task-guides/deploy-valkey-redis/)

## 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 |
| --- | --- |
| `valkeyPassword` | Required |
| `prometheus` | Optional |
| `storageClasses` | Optional |

## Options

### `image`

Image of valkey-server and the Sentinel sidecar.

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

  ```nix
  {
    digest = "sha256:3add1a336a920ea54770a001ab6feb3da5fceea96a40373a3a2cd469b815f0b7";
    pullPolicy = "IfNotPresent";
    repository = "docker.io/valkey/valkey";
    tag = "9.1.3";
  }
  ```

### `image.digest`

Resolved manifest digest, `sha256:` followed by 64 hex characters. What will actually run. Null means not resolved.

- **Type:** `null or string`
- **Default:** the package's digest while `tag` is the package's tag, otherwise null

### `image.note`

Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.

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

### `image.promotedBy`

Who resolved this pin, for the record. Null when unknown.

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

### `image.pullPolicy`

imagePullPolicy for containers using this image. Null leaves it to Kubernetes.

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

### `image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"docker.io/valkey/valkey"`

### `image.resolvedAt`

When this pin was resolved, RFC 3339. Null when unknown.

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

### `image.sourceRev`

Revision of the source the image was built from, when Kix built it. Null for upstream images.

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

### `image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"9.1.3"`

### `metrics.enabled`

Run the redis_exporter sidecar, a metrics Service, a
ServiceMonitor, and alerts when the cluster has a prometheus
provider. The sidecar is part of the pod template, so adding the
first prometheus provider, or turning this off, restarts every
pod; a standalone instance is down while its pod restarts.

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

### `metrics.extraArgs`

Flags appended to the exporter's command line. The package owns the flags for the address, credentials, listen address, and metrics path.

- **Type:** `list of string`
- **Default:** `[ ]`
- **Example:**

  ```nix
  [
    "--include-system-metrics"
  ]
  ```

### `metrics.image`

Image of the metrics exporter sidecar.

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

  ```nix
  {
    digest = "sha256:6ca518a72f30f7f576ef92963de1b91d3c3f5fd3aeac949f878bfda183587820";
    pullPolicy = "IfNotPresent";
    repository = "docker.io/oliver006/redis_exporter";
    tag = "v1.93.0";
  }
  ```

### `metrics.image.digest`

Resolved manifest digest, `sha256:` followed by 64 hex characters. What will actually run. Null means not resolved.

- **Type:** `null or string`
- **Default:** the package's digest while `tag` is the package's tag, otherwise null

### `metrics.image.note`

Whatever a person wanted to say about this pin. Kix never reads it and a promotion never discards it. Declared here for the same reason as the three fields above: a pin carries its own record-keeping, and the option accepts the whole pin rather than a subset of it.

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

### `metrics.image.promotedBy`

Who resolved this pin, for the record. Null when unknown.

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

### `metrics.image.pullPolicy`

imagePullPolicy for containers using this image. Null leaves it to Kubernetes.

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

### `metrics.image.repository`

Image repository, registry host included.

- **Type:** `string`
- **Default:** `"docker.io/oliver006/redis_exporter"`

### `metrics.image.resolvedAt`

When this pin was resolved, RFC 3339. Null when unknown.

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

### `metrics.image.sourceRev`

Revision of the source the image was built from, when Kix built it. Null for upstream images.

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

### `metrics.image.tag`

Image tag. What was asked for.

- **Type:** `string`
- **Default:** `"v1.93.0"`

### `metrics.interval`

Scrape interval (e.g. "30s"). Null = use Prometheus default.

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

### `metrics.resources`

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

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

  ```nix
  {
    limits = {
      cpu = "1";
      memory = "128Mi";
    };
    requests = {
      cpu = "50m";
      memory = "64Mi";
    };
  }
  ```

### `metrics.resources.claims`

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

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

### `metrics.resources.claims.*.name`

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

- **Type:** `string`

### `metrics.resources.claims.*.request`

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

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

### `metrics.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:** `{ }`

### `metrics.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:** `"1"`

### `metrics.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`

### `metrics.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:** `"128Mi"`

### `metrics.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:** `{ }`

### `metrics.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:** `"50m"`

### `metrics.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`

### `metrics.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:** `"64Mi"`

### `replicas`

Pods of the StatefulSet. Standalone Valkey runs one; with Sentinel, one is the primary and the others replicate it. After a scale-down, Sentinel lists the removed replicas until `SENTINEL RESET primary` runs on each Sentinel.

- **Type:** `positive integer, meaning >0`
- **Default:** 3 with Sentinel, else 1

### `resources`

Resources of the valkey container. `limits.memory` also sets the built-in `maxmemory`.

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

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

### `resources.claims`

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

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

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

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

- **Type:** `string`

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

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

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

### `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:** `{ }`

### `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:** `"1"`

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

### `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:** `"512Mi"`

### `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:** `{ }`

### `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:** `"250m"`

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

### `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"`

### `sentinel.enabled`

Run a Sentinel sidecar in every pod, so a replica takes over when the primary is lost.

- **Type:** `boolean`
- **Default:** true from availability level `node` up

### `sentinel.primarySettings`

Sentinel settings for the monitored primary, rendered as
`sentinel <key> primary <value>`. They apply over the built-ins
`down-after-milliseconds = 3000`, `failover-timeout = 10000`, and
`parallel-syncs = 1`; null drops one. Keys are lower case, and
values have no line breaks.

- **Type:** `attribute set of (null or signed integer or string without line breaks)`
- **Default:** `{ }`
- **Example:**

  ```nix
  {
    down-after-milliseconds = 5000;
  }
  ```

### `sentinel.quorum`

Sentinels that must agree the primary is down before a failover starts (the quorum of `sentinel monitor`).

- **Type:** `positive integer, meaning >0`
- **Default:** `2`

### `sentinel.resources`

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

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

  ```nix
  {
    limits = {
      cpu = "250m";
      memory = "128Mi";
    };
    requests = {
      cpu = "50m";
      memory = "64Mi";
    };
  }
  ```

### `sentinel.resources.claims`

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

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

### `sentinel.resources.claims.*.name`

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

- **Type:** `string`

### `sentinel.resources.claims.*.request`

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

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

### `sentinel.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:** `{ }`

### `sentinel.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:** `"250m"`

### `sentinel.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`

### `sentinel.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:** `"128Mi"`

### `sentinel.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:** `{ }`

### `sentinel.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:** `"50m"`

### `sentinel.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`

### `sentinel.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:** `"64Mi"`

### `settings`

valkey.conf directives over the built-ins `appendonly = "yes"` and
`maxmemory`, which is 70% of `resources.limits.memory` when that is
set. A bool renders yes or no, a list one line per element, and null
drops a built-in. Keys are lower case, and values have no line
breaks. The directives the package owns (`port`, `bind`, the
password and replication user, replication, `dir`, `include`,
`user`, `aclfile`, `daemonize`, `rename-command`) are refused.

- **Type:** `attribute set of (null or string without line breaks or signed integer or boolean or list of string without line breaks)`
- **Default:** `{ }`
- **Example:**

  ```nix
  {
    maxmemory-policy = "allkeys-lru";
    save = [
      "900 1"
      "300 10"
    ];
  }
  ```

### `storage.size`

Volume requested for each pod, holding the AOF and RDB files.

- **Type:** `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:** `"8Gi"`

### `storage.storageClassName`

StorageClass of the volumes. Null takes the class from the storageClasses dependency, or with none the cluster default.

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