Scalable kubernetes redis cluster.
- Create a separate namespace to isolate redis components:
kubectl create ns redis
- Create a Secret and call it
redis-secret
withREDIS_PASSWORD
in it:kubectl -n redis create secret generic redis-secret \ --from-literal=REDIS_PASSWORD=$(echo -n your_secret_password | base64)
- Apply Redis ConfigMap:
kubectl -n redis apply -f kubernetes/config/redis-configmap.yaml
- Apply Redis StatefulSet (change amount of replicas if needed, default is 3):
kubectl -n redis apply -f kubernetes/config/redis-statefulset.yaml
- Apply Sentinel StatefulSet (amount of replicas has to be greater than 3):
kubectl -n redis apply -f kubernetes/config/sentinel-statefulset.yaml