A 6-node Redis cluster you can run locally for development and testing. Available as both Docker Compose and Kubernetes configurations. Pulls the latest version of Redis, which includes search, JSON, time series, and probabilistic data structure modules.
cd docker-compose
docker compose up -dYour cluster is available at localhost:7001–localhost:7006.
Requires Docker Desktop with Kubernetes enabled.
kubectl apply -R -f kubernetes/Watch for all pods to show Running and the init job to show Completed:
kubectl get pods -wYour cluster is available at localhost:30001–localhost:30006.
Each cluster has 6 nodes accessible from localhost. Your app connects to these ports and uses a node address map to translate the internal hostnames that Redis advertises back to localhost.
| Environment | Ports |
|---|---|
| Docker Compose | 7001–7006 |
| Kubernetes | 30001–30006 |
Both clusters can run simultaneously since the ports don't overlap.
See the app/ directory for a working Node.js example using node-redis that connects to the cluster, seeds data, and runs search queries.
Three simulated machines (alfa, bravo, charlie), each running one primary and one replica. Redis uses cluster-announce-human-nodename to track machine affinity, keeping a primary and its replica on different machines — just like a production deployment.
cd docker-compose
docker compose downkubectl delete -R -f kubernetes/Both configurations use the redis:latest tag. To pick up a new version:
cd docker-compose
docker compose pull
docker compose down && docker compose up -dkubectl rollout restart statefulset redisWithin the same major version line, upgrades are seamless — Redis handles data format changes automatically. If anything goes sideways after an upgrade, wipe the data and start fresh:
# Docker Compose
cd docker-compose
docker compose down -v && docker compose up -d
# Kubernetes
kubectl delete -R -f kubernetes/
kubectl delete pvc -l app=redis
kubectl apply -R -f kubernetes/- Docker Desktop
- Kubernetes enabled in Docker Desktop (for the Kubernetes setup)