Git Product home page Git Product logo

mariadb-galera-operator's Introduction

MariaDB Galera Cluster operator

Concept for implementation of boilerplate largely based on:

Requirements:

Automated cluster bootstraping Resilient to single node failure Undisrupted during pod (re)integration Handles backups automatically Handles restores automaticaly Should recover fresh nodes quickly from local snapshot Exposing metrics for collection / alerting

Means to achieve:

Bootstraping

Use StatefulSet to have a predictable network identity. Assume 3 replicas at minimum which can be treated as the core nodes to which additional nodes can initiate during bootstrap. Leader election: Snapshots need to ensure only one pod is writing to the shared storage, leader election will indicate which POD is a master pod and as such allowed to save snapshot. Other PODs will be acting as hot standby.

Snapshoting

From elected master a quick method to save database dump to snapshot folder is required. For that use of xtrabackup seems inevitable.

non-client facing snapshot node ? incremental snapshots what if snapshot pod changes? incremental snap corruption ?

Backups

After snapshot is complete, it should be transferred to external storage according to expected retention rules (ie. daily, hourly etc., keeping always last week, every second for a month, every seventh for a year)

Recovery

Be able to define that in case of lack of or corrupted snapshot, dump can be downloaded from some location to seed the database. Seed process needs to be a part of init and blocking for startup of other pods in StatefulSet https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#ordered-pod-creation

point in time recovery ? corrupted snapshot ?

Resources

Default values for CPU and memory allocation, small alocation,

alerting when potentialy too small ?

Scheduling

Databases should never be scheduled on the same physical node. To achieve that a Pod-AntiAffinity needs to be configured so that two pods for db can never be scheduled side by side.

Upgrades

Test for seamless upgrades to newer version of MariaDB engine

Growing storage space

Needs to accommodate for uninterrupted storage space growth. Applying with modified size and deleting pods sequentially should be enough, make use of snapshot and IST to recover data on new pod.

could it grow automaticaly ? define both starting and max PV size ? would it require PVC creation outside of POD volumeClaimTemplates to avoid reset of size on oc apply?

Monitoring

CPU Memory IO MySQL Metrics Galera metrics

Other notes

Readiness probe to check for status (ie. exclude new node and donor untill IST is done) What should happen when MariaDBCluster object is deleted, can w have some kind of deletion protection ? Should be marked as critical cluster pod as failure during bootstrap may be an issue / handle mid-bootstrap interruptions

Future considerations

Implement ProxySQL for a more intelligent routing to backends (avoiding direct use of service via kube-proxy) Use PodPreset to inject credentials automatically

mariadb-galera-operator's People

Contributors

goblain avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.