What is Valkey Cluster?
Valkey Cluster shards the keyspace across multiple master nodes for horizontal scale - the same design as Redis Cluster, BSD-licensed and Redis-protocol compatible. This template runs six nodes (three masters + three replicas) and a one-shot init that forms the cluster.
Nodes announce their service hostname so clients and redirects use DNS instead of raw pod IPs; the forming init is idempotent. Use it when a single node’s RAM or throughput is not enough.
For failover of a single dataset without sharding, valkey-sentinel is simpler; for one node, use valkey. Existing Redis Cluster client libraries work unchanged.
What you get
- Automatic sharding across 3 master shards
- 6 nodes (3 masters + 3 replicas) + forming init
- Hostname-announced nodes for DNS-based routing
- Redis Cluster clients work unchanged
- All internal-only, password-protected
- BSD-3-Clause licensed
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
valkey-node-1..6 | 3 masters + 3 replicas (:6379) | no (internal) |
valkey-init | forms the cluster once, then exits | no |
Before you deploy
VALKEY_PASSWORDshared by every node and the init
Sizing and billing
Six in-memory nodes - size RAM to the total dataset across 3 shards plus replicas. Experimental: like all cluster modes it expects stable node identity on a per-pod platform.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 29.3 GiB of volumes cost $0.15 per GiB a month ($4.40/mo) for as long as they exist. One workspace can use both. See pricing
Compared with the managed service
| Service | Plan | Price | Includes |
|---|---|---|---|
| AWS ElastiCache | cluster mode (6 nodes) | $72/mo | 3 shards + 3 replicas on-demand/mo at the smallest size |
Managed sharded caches bill every node; the full 6-node cluster here is one stack, billed for the compute it reserves, BSD-licensed. Prices from each vendor's pricing page, June 2026.
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
How does it relate to Redis Cluster?
Valkey Cluster is the same sharding design and wire protocol, under the permissive BSD license. Redis Cluster client libraries connect to the valkey-node-* services unchanged.
Why experimental?
Cluster mode expects stable node identities and is sensitive to address changes on per-pod platforms. Nodes announce service hostnames so routing uses DNS, but a pod IP change can require a re-meet - a power-user topology.
Cluster or Sentinel?
Cluster shards for scale; Sentinel (valkey-sentinel) gives failover HA for a single dataset. Choose Cluster only when one node cannot hold the data or serve the throughput.