Orange-OpenSource / galera-operator

Galera Operator automates tasks for managing a Galera cluster in Kubernetes
Apache License 2.0
34 stars 18 forks source link

[question] Exposing cluster to outside world. #14

Closed maxshilov closed 3 years ago

maxshilov commented 3 years ago

Could you please provide an example of how I can expose cluster for the outside world for read/write ops?

Is it right that service/gal-writer-bkp-svc and service/gal-writer-svc are not supposed to receive read ops?

sebs42 commented 3 years ago

Hello,

as described here, you have several services : https://github.com/Orange-OpenSource/galera-operator/blob/master/doc/user/services.md

gal-writer-bkp-svc and gal-writer-svc can also receive read requests, in this case, you will not use the best way galera cluster : 1 master to write and other servers used to read

Example of how to consume galera cluster is out of scope, but from an internal projet (ie hosted in k8s running galera cluster) you just have to give the dns like this: apiVersion: apps/v1 kind: Deployment metadata: name: guestbook namespace: galera labels: app: guestbook spec: replicas: 1 selector: matchLabels: app: guestbook template: metadata: labels: app: guestbook spec: containers:

maxshilov commented 3 years ago

@sebs42 Thank you for your answer!

If we have separate instances for reads and writes what is the point of having a multi-master feature turned on?

sebs42 commented 3 years ago

Hello

It’s better to use Galera like that because when writing on several masters you can have trouble if your requests change the same data (roll back and so on). Using Galera is to have a better solution for high availability than classical master-backup. Generally you don’t tell your développer to use several services (one for read and one for write) but you configure a tool like proxysql to use the right service. This part is not open sourced from my compagny because we designed a specific tool with a custom kubernetes cluster (pod are routed and services are available without nodeport)

Regards Sébastien

On 20 Oct 2020, at 20:45, Maxim Shilov notifications@github.com wrote:

 @sebs42 Thank you for your answer!

If we have separate instances for reads and writes what is the point of having a multi-master feature turned on?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.