I'm getting acquainted with Kubernetes, and haven't found simple solution for deploying stateful services in Kubernetes.
- Every pod has to be bootstrapped with contact points (list of other pod IPs), which can't be load balanced (i'm afraid of split-brain in case of bad luck: in worst case load-balancer may load-balance every pod to itself, making several self-enclosed clusters of one node)
- Every pod has to have persistent storage that, in worst case, has to be accessed manually (e.g. consul's peers.json)
- Every pod should be reconfigurable; if i've forgot to do something with my consul cluster, rebuilding it from scratch would simply result in downtime. In case kubernetes prevents this, feel free to tell me, i'm still not familiar enough with deployment mechanics.
- Increasing service cluster dynamically with newly-configured instances and then draining older ones may be highly undesired (i'm not consul expert, but from my point of view that drops split-brain protection in consul cluster).
AFAIK the most applicable thing is Pet Set, however, it is still in alpha and can only be deleted completely; also, i don't feel i understand how persistent volumes should be managed to survive Pet Set recreation. Another option i've came up with is splitting service deployments into bootstrap-node deployment, bootstrap-node service and all-other-nodes deployment, which allows me to use bootstrap-node service as a contact point (that's not completely safe, though).
What are the popular approaches for this case and what pros and cons do they have?