Create an instance
Use the high-level Valkey custom resource for application instances. The next
major release, 2.0.0, supports only 7.2, 8.1, and 9.1 in spec.version.
Before you begin
- Choose
cluster, failover, or replica architecture.
- Set CPU and memory requests and limits. Equal request and limit values avoid a
validating-webhook warning; size the exporter sidecar separately when it is
enabled.
- Configure persistent storage for data that must survive Pod recreation.
- Use at least two members per shard for primary-replica redundancy.
Choose the main fields
If storageClassName is specified without capacity, the webhook derives a
capacity equal to twice the data-container memory limit. Set capacity explicitly
for predictable storage planning.
Create a Cluster instance
This example creates three shards with two members in each shard:
kubectl apply -f - <<'EOF'
apiVersion: rds.valkey.buf.red/v1alpha1
kind: Valkey
metadata:
name: valkey-cluster
namespace: default
spec:
version: "8.1"
arch: cluster
replicas:
shards: 3
replicasOfShard: 2
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"
storage:
storageClassName: standard
capacity: 10Gi
access:
serviceType: ClusterIP
exporter:
resources:
requests:
cpu: "50m"
memory: "128Mi"
limits:
cpu: "100m"
memory: "384Mi"
affinityPolicy: AntiAffinityInShard
customConfigs:
maxmemory-policy: allkeys-lru
appendonly: "yes"
EOF
Create a Failover instance
This example creates two data members and three Sentinels:
kubectl apply -f - <<'EOF'
apiVersion: rds.valkey.buf.red/v1alpha1
kind: Valkey
metadata:
name: valkey-failover
namespace: default
spec:
version: "8.1"
arch: failover
replicas:
shards: 1
replicasOfShard: 2
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"
storage:
storageClassName: standard
capacity: 10Gi
access:
serviceType: ClusterIP
sentinel:
replicas: 3
quorum: 2
resources:
requests:
cpu: "200m"
memory: "256Mi"
limits:
cpu: "200m"
memory: "256Mi"
monitorConfig:
down-after-milliseconds: "30000"
failover-timeout: "180000"
parallel-syncs: "1"
customConfigs:
maxmemory-policy: allkeys-lru
appendonly: "yes"
EOF
Create a Replica instance
This example creates one primary and one replica without Sentinel:
kubectl apply -f - <<'EOF'
apiVersion: rds.valkey.buf.red/v1alpha1
kind: Valkey
metadata:
name: valkey-replica
namespace: default
spec:
version: "8.1"
arch: replica
replicas:
shards: 1
replicasOfShard: 2
resources:
requests:
cpu: "500m"
memory: "1Gi"
limits:
cpu: "500m"
memory: "1Gi"
storage:
storageClassName: standard
capacity: 10Gi
access:
serviceType: ClusterIP
customConfigs:
maxmemory-policy: allkeys-lru
appendonly: "yes"
EOF
Set replicasOfShard: 1 only when you intentionally want a single data node and
accept the lack of primary-replica redundancy.
Verify the instance
Watch the high-level status until PHASE becomes Ready:
kubectl -n default get valkey -w
Then inspect the observed nodes, child resources, Pods, Services, and persistent
volume claims (PVCs):
kubectl -n default get valkey valkey-cluster -o yaml
kubectl -n default get cluster,failover,sentinel
kubectl -n default get pods,service,pvc -l buf.red/name=valkey-cluster
kubectl -n default describe valkey valkey-cluster
If reconciliation fails, read .status.message, namespace Events, and the
Operator logs before changing the manifest.
The main kubectl get valkey columns are:
After Ready, verify the architecture rather than relying only on the phase:
# Cluster
kubectl -n default exec <ready-cluster-pod> -c valkey -- \
valkey-cli CLUSTER INFO
# Failover or Replica
kubectl -n default exec <ready-data-pod> -c valkey -- \
valkey-cli INFO replication
For an explicit initial Cluster slot layout, use
Initialize Cluster slot distribution.