🦭 mariadb-operator
Run and operate MariaDB in a cloud native way. Declaratively manage your MariaDB using Kubernetes CRDs rather than imperative commands.
- Easily provision standalone MariaDB servers in Kubernetes.
- Multiple highly available topologies supported:
- Flexible storage configuration. Volume expansion.
- Physical backups based on mariadb-backup and Kubernetes VolumeSnapshots.
- Logical backups based on mariadb-dump.
- Multiple backup storage types: S3 compatible, PVCs, Kubernetes volumes and
VolumeSnapshots.
- Flexible backup configuration: scheduling, compression, retention policy, timeout, staging area...
- Target recovery time: restore the closest available backup to the specified time.
- Bootstrap new instances from: Physical backups, logical backups, S3, PVCs,
VolumeSnapshots...
- Cluster-aware rolling update: roll out replica Pods one by one, wait for each of them to become ready, and then proceed with the primary Pod, using
ReplicasFirstPrimaryLast.
- Manual update strategies:
OnDelete and Never.
- Automated data-plane updates.
- my.cnf change detection. Automatically trigger updates when my.cnf changes.
- Suspend operator reconciliation for maintenance operations.
- Issue, configure and rotate TLS certificates and CAs.
- Native integration with cert-manager. Automatically create
Certificate resources.
- Prometheus metrics via mysqld-exporter and maxscale-exporter.
- Native integration with prometheus-operator. Automatically create
ServiceMonitor resources.
- Declaratively manage SQL resources: users, grants and logical databases.
- Declaratively manage resources in external MariaDB instances.
- Configure connections for your applications.
- Orchestrate and schedule sql scripts.
- Validation webhooks to provide CRD immutability.
- Additional printer columns to report the current CRD status.
- CRDs designed according to the Kubernetes API conventions.
- Install it using helm, OLM or static manifests.
- Multiple deployment modes: cluster-wide and single namespace.
- Helm chart to deploy MariaDB clusters and its associated CRs.
- Multi-arch distroless image.
- GitOps friendly.
Documentation
For the user manual, getting started, guides, and API reference, please see the 📚docs directory.
Examples catalog
For example Custom Resources (CRs) demonstrating how to use the operator, refer to the 🛠️examples directory.
Helm installation
You can easily deploy the operator to your cluster by installing the mariadb-operator-crds and mariadb-operator Helm charts:
helm repo add mariadb-operator https://helm.mariadb.com/mariadb-operator
helm install mariadb-operator-crds mariadb-operator/mariadb-operator-crds
helm install mariadb-operator mariadb-operator/mariadb-operator
Refer to the helm documentation for further detail.
Upgrading from older releases
When upgrading from an older version of the operator, it’s important to understand how both operator and operand resources are affected. Ensure you read both the updates section of the helm docs, and the release notes for any additional version-specific steps that may be required. Do not attempt to skip intermediate version upgrades. Upgrade progressively through each version to the next.
Openshift installation
The Openshift installation is managed separately in the mariadb-operator-helm repository, which contains a helm based operator that allows you to install mariadb-operator via OLM.
Image compatibility
mariadb-operator is only compatible with official MariaDB images. Refer to the images documentation for further detail.
MariaDB compatibility
- MariaDB Community >= 10.6
MaxScale compatibility
Kubernetes compatibility
- Kubernetes >= 1.31
- OpenShift >= 4.18
Migrate your MariaDB instance to Kubernetes
This migration guide will streamline your onboarding process and assist you in migrating your data into a MariaDB instance running on Kubernetes.
GitOps
You can embrace GitOps best practises by using this operator, just place your CRDs in a git repo and reconcile them with your favorite tool, see an example with flux:
Roadmap
Take a look at our roadmap and feel free to open an issue to suggest new features.
Adopters
Please create a PR and add your company or project to our ADOPTERS.md file if you are using our project!
Contributing
We welcome and encourage contributions to this project! Please check our contributing and development guides. PRs welcome!
Get in touch
Join us on Slack: MariaDB Community Slack.
Star history
