sanderploegsma / redis-cluster

Redis Cluster setup running on Kubernetes
https://sanderp.nl/running-redis-cluster-on-kubernetes-e451bda76cad
MIT License
246 stars 132 forks source link

add failover script + split configmap from statefulset #12

Closed sp-joseluis-ledesma closed 5 years ago

sp-joseluis-ledesma commented 5 years ago

I don't know if this may be useful for other people. I have created a pre-stop lifecycle which verifies if it is an actual master, and switches the service to its slave if so.

Also I have split the configmap from the statefulset to avoid having one big file.

sanderploegsma commented 5 years ago

I like the idea of automating the failover when a master pod shuts down. However, we're nearing a point where it makes more sense to tread into CRD domain and create an operator that manages the cluster.

I would also like to avoid this repo becoming a collection of scripts one might find useful, it mainly serves as an example on how to set up a stateful application inside Kubernetes. It's quite outdated too: a quick Google search on "redis cluster operator" shows a bunch of open source projects providing a far better setup compared to what I cooked up.