Closed sp-joseluis-ledesma closed 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.
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.