Skip to content

Redis-compatible caches

A ManagedValkey is a Valkey instance — a Redis-compatible, BSD-licensed key/value store — for a cache or a Celery-style queue broker. It renders directly, with no separate operator: one StatefulSet, one headless Service, one credentials Secret.

apiVersion: paas.paasbox.com/v1alpha1
kind: ManagedValkey
metadata: { name: broker, namespace: shop }
spec:
plan: s
persistence: true
maxmemoryPolicy: noeviction
status:
conditions: [Reconciled, Ready, Degraded]
phase: Ready
endpoint: { host: broker.shop.svc, port: 6379 }
secretName: broker-credentials

ManagedValkey has no backups, no point-in-time recovery and no restore. As a cache, that is the point: losing the data costs a few slow requests while it refills. As a queue broker, set persistence: true to keep the append-only file on a volume across restarts, and design consumers to be idempotent — a task can, in principle, be delivered more than once. If you need the data itself to survive, put it in PostgreSQL, not here.

  • planxs, s, m or l, sizing cpu, memory and the storage floor:

    PlanCPUMemoryStorage floor (persistence on)
    xs100m128Mi1Gi
    s250m256Mi1Gi
    m500m512Mi2Gi
    l11Gi4Gi
  • version8, the only supported major today.

  • persistencefalse by default (a cache: recreated, not restored, if it is ever lost). Set only when you create the object — changing it later means a new instance.

  • storage — the volume size when persistence: true; the plan’s floor applies if you set less. Also set on create only.

  • maxmemoryPolicynoeviction (default: at maxmemory, writes fail instead of a key being dropped — the right choice for a broker) or allkeys-lru (evict the least-recently-used key — the right choice for a cache). maxmemory itself is set automatically to 80% of the plan’s memory.

  • hibernatedtrue scales the instance to zero and keeps its volume, if any.

The credentials Secret and using it from an App

Section titled “The credentials Secret and using it from an App”

status.secretName carries the servicebinding.io keys type, provider, host, port, password, uri — the uri is a plain redis://… URL, so any Redis client library works unchanged.

# on the App
uses: [{ name: broker, kind: ManagedValkey, prefix: REDIS_ }]

injects REDIS_HOST, REDIS_PORT, REDIS_PASSWORD and REDIS_URI as references into broker-credentials. See deploy an app for a worker App that consumes a broker this way.