Comments (7)
just some thoughts:
using maxscale as sql router would allow to make readwrite split on a single port/service available (see https://mariadb.com/kb/en/mariadb-maxscale-6-read-write-splitting-with-mariadb-maxscale/) the advantage is, that the galeramon "talks" mariadb and knows about the node states (both for replication scenario and galera multimaster) and would take care about writing only to a single node andreading from multiple nodes itself - it doesn't need separate services tobe used from the outside.
Integration into the operator would probably be not too difficult, as it just requires some functional db user and some config.
I think there are some license restrictions which I can't find right now in the documentation - so I am not sure if that is a good idea - a "kubernetes native" solution also has it's advantages - just wanted to mention that and maybe others can also give some experience to that. (I am currently running maxscale in front of both maria db operator controlled replica and galera and testing it)
from mariadb-operator.
MaxScale's problem can be it's license.
It's BSL, which expires to GPL
https://github.com/mariadb-corporation/MaxScale/blob/23.02/LICENSE2302.TXT
from mariadb-operator.
The naming convention for
Services
would be:
<mariadb-name>
: To be used for read requests. It will point to all nodes<mariadb-name>-primary
: To be used for write requests. It will point to a single node.
The only wish I'd like to add is one more service:
<mariadb-name>-secondary
: To be used only for read requests. It should point to all nodes, except the primary one.
from mariadb-operator.
Hey there @kvaps !
I do agree that this can be something very interesting to support, as it will allow us to address the replicas without hitting the primary for serving read requests.
Unfortunately, unlike CloudNativePG
, we rely on the StatefulSet
construct under the hood, which implies that all the Pods
will have the same labels and therefore there is no way to selectively address only some of them. The only exception is the statefulset.kubernetes.io/pod-name: mariadb-galera-0
, which is the label we rely on to configure the <mariadb-name>-primary
primary service. See one of our Pod
labels as an example:
apiVersion: v1
kind: Pod
metadata:
labels:
app.kubernetes.io/instance: mariadb-galera
app.kubernetes.io/name: mariadb
statefulset.kubernetes.io/pod-name: mariadb-galera-0
name: mariadb-galera-0
For this to happen, we would need to manage Pods
separately, not relying on a StatefulSet
and label them based on their role. See one of the CloudNativePG
Pods
as an example:
apiVersion: v1
kind: Pod
metadata:
labels:
cnpg.io/cluster: cluster-example
cnpg.io/instanceName: cluster-example-1
cnpg.io/podRole: instance
postgresql: cluster-example
role: primary
name: cluster-example-1
I'm open to ideas and suggestions!
from mariadb-operator.
The only exception is the statefulset.kubernetes.io/pod-name: mariadb-galera-0, which is the label we rely on to configure the -primary primary service. See one of our Pod labels as an example
I think managing of such labels for the every pod (better on the pod side) pretty common pattern. But if you do not want to manage labels, relying on statefulset-controller, there is an another option to create and update endpoints for service directly.
from mariadb-operator.
I think managing of such labels for the every pod (better on the pod side) pretty common pattern. But if you do not want to manage labels, relying on statefulset-controller, there is an another option to create and update endpoints for service directly.
That's a pretty neat suggestion, will follow this approach. Just updated the issue body. 🙏🏻
using maxscale as sql router would allow to make readwrite split on a single port/service available
Supporting MaxScale is definetly we want to support at some point, will create a separate issue for it. I think we should support both the "kubernetes native" Services
and also have the ability to deploy and configure a MaxScale instance which will have also its own Service
to make it addresable from inside and even outside (LoadBalancer
) of the cluster.
from mariadb-operator.
This has been supported via the following PRs:
To be released in v0.0.20
! Stay tuned! 🚀
from mariadb-operator.
Related Issues (20)
- [Bug] Resource Limits not correct set
- [Bug] manifests yaml was deleted after automatic upgrade
- Support for successfuljobshistorylimit and failedjobshistorylimit in backups.k8s.mariadb.com
- [Bug]
- [Feature] Protect ressources to prevent accidential deletion/data loss HOT 1
- [Feature] Backup encryption
- [Feature] UBI9 support for all system Docker images HOT 1
- [Feature] IBM Power Docker images
- [Bug] Galera Init job keeps failing HOT 2
- [Bug] MariaDB-10.4 compatibility due to REPLICATION REPLICA being a 10.5+ grant HOT 1
- [Feature] Manage initial user with `User` CR
- [Feature] Manage initial database and user with `Database` with and `User` CRs
- [Feature] Improve `Connection` reconciliation. Password rotation
- [Feature] Improve `MaxScale` reconciliation. Password rotation
- [Feature] Improve `MariaDB` reconciliation. Password rotation
- [Bug] Galera with maxScale is failing to recover
- [Bug] Galera cluster failed to recovery HOT 1
- Issue: `mariadb-operator-(webhook)` stuck in starting workers, watching certificates
- [Bug] [0.29.0] GRANT - sql error HOT 1
- [Bug] Helm repo change breaks umbrella charts
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mariadb-operator.