Free audit

View Audit Scope
Kubernetes & mariadb-operatorCloud-native Galera & MaxScale CRDs

MariaDB on Kubernetes: Operator, Galera & StatefulSet Engineering

JusDB designs, deploys, and operates MariaDB on Kubernetes across Amazon EKS, Google GKE, Azure AKS, and bare-metal OpenShift. Database engineers configure mariadb-operator Custom Resource Definitions (MariaDB, MaxScale, Backup, Restore), multi-AZ Galera 4 StatefulSets, PodDisruptionBudgets, and low-latency CSI block storage, backed by 24/7 incident response.

The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance.

  • NDA before access
  • Read-only by default
  • Written scope before work starts

Kubernetes MariaDB stack

Select a Kubernetes layer

Declarative Galera & Semi-Sync StatefulSets

k8s.mariadb.com

Manage 3-node Galera 4 clusters or GTID semi-synchronous topologies via the MariaDB Custom Resource, with automated quorum recovery and rolling updates.

Includes podAntiAffinity across worker zones and pinned QoS memory requests equal to limits.

See MariaDB CRD manifest specimen

Built around the CNCF mariadb-operator (k8s.mariadb.com) on EKS, GKE, AKS, and OpenShift.

Kubernetes platforms
Amazon EKS, Google GKE, Azure AKS, Red Hat OpenShift, and bare-metal Kubernetes
Core CRDs & primitives
MariaDB (Galera 4 / Semi-Sync), MaxScale, PhysicalBackup, PDBs, and CSI block storage
Response SLA
15 mins for a critical (P1) cluster outage, 24/7. See details

Selected clients

  • Innoviti
  • Blitz
  • Freecharge
  • Nango
  • Recochain
  • Screen Facts
  • Nexora
  • WeCredit

When teams call us

MariaDB on Kubernetes failure modes we solve

Running stateful MariaDB inside Kubernetes requires aligning Linux cgroup memory limits, kubelet eviction budgets, liveness probes, and CSI volume binding with InnoDB and Galera internals.

Common MariaDB on Kubernetes symptoms, what is usually happening, and where JusDB engineers start
SymptomWhat is usually happeningWhere we start
OOMKilled (Exit 137)Kubernetes kernel kills the MariaDB pod during analytical queriesinnodb_buffer_pool_size plus per-connection sort/join buffers and Galera gcache memory allocation exceed the pod's cgroup memory.limits.Set pod QoS to Guaranteed (requests.memory == limits.memory), cap innodb_buffer_pool_size at 65–70% of container memory, and enable pool-of-threads.
Kubelet drain quorum lossCluster autoscaler or EKS/GKE node upgrade drops Galera quorumTwo Galera pods were scheduled onto the same worker node or drained simultaneously because no PodDisruptionBudget or topologySpreadConstraints were defined.Enforce requiredDuringSchedulingIgnoredDuringExecution podAntiAffinity across topology.kubernetes.io/zone and set PodDisruptionBudget maxUnavailable: 1.
Liveness probe SST killRejoining Galera pod enters CrashLoopBackOff during state transferAn aggressive HTTP/TCP livenessProbe times out while mariabackup SST is streaming data, causing kubelet to restart the joiner pod in an endless loop.Use mariadb-operator's wsrep-aware startupProbe and livenessProbe configurations that allow Donor/Joiner SST states to complete without restarts.
Multi-Attach Volume errorRescheduled StatefulSet pod hangs waiting for EBS/PD disk attachA failed worker node has not detached the ReadWriteOnce block volume, or the StorageClass uses Immediate binding instead of WaitForFirstConsumer in a multi-AZ cluster.Configure volumeBindingMode: WaitForFirstConsumer on the CSI StorageClass, align pod anti-affinity with AZs, and tune node fencing timeouts.
NFS / EFS InnoDB corruptionSevere fsync latency, lock stalls, or corrupted tablespaces in K8sStatefulSet PVCs were provisioned on shared NFS/EFS storage where POSIX file locking and O_DIRECT semantics break InnoDB redo log and Galera gcache writes.Migrate PVCs onto dedicated ReadWriteOnce block storage (AWS EBS gp3/io2, GCP pd-ssd/hyperdisk, Azure Premium SSD, or local NVMe with Rook-Ceph/OpenEBS).
ClusterIP connection dropsRolling pod restarts drop active application transactionsApplications connect directly to a basic Kubernetes Headless or ClusterIP Service that routes to pods before Galera wsrep_ready=ON or during shutdown.Deploy the MaxScale CRD with readiness probes tied to wsrep_local_state=4 (Synced) and enable transaction_replay for zero-drop rolling updates.

Engineering workflow and SLA response times

How JusDB builds and supports MariaDB on Kubernetes

We deliver GitOps-ready CRD manifests and drill node drains before production launch. 24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins.

Four-step Kubernetes MariaDB engineering protocol

  1. Assess

    Audit K8s worker zones, CSI storage, and memory limits

    Verify EBS/PD IOPS ceilings, node sizing, CNI latency, and existing Helm or operator manifests.

  2. Architect

    Author MariaDB, MaxScale, and PhysicalBackup CRDs

    Declarative GitOps manifests with Guaranteed QoS, podAntiAffinity, and PodDisruptionBudgets.

  3. Drill

    Test pod kill, node drain, and S3 PITR restore

    Prove that node upgrades, pod evictions, and full cluster bootstrap recovery run cleanly.

  4. Operate

    Wire ServiceMonitors and 24/7 on-call cover

    Prometheus alerts for Galera state, PVC growth, and cgroup memory pressure.

SLA response times for Kubernetes DB incidents

  • 15 mins

    P1 · Critical

    P1 incidents

  • 30 mins

    P2 · High

    P2 incidents

  • 60 mins

    P3 · Medium

    P3 incidents

SeverityResponse SLADefinitionChannel & coverage
P1 · Critical15 minsProduction database down, primary unreachable, data corruption risk, or active failover event.24/7 · Direct PagerDuty, Opsgenie, or phone page plus incident bridge
P2 · High30 minsSevere latency spike, replication lag climbing rapidly, connection exhaustion, or degraded HA node.24/7 · On-call alert plus shared Slack or Teams channel
P3 · Medium60 minsNon-critical slow query regression, staging issue, backup warning, configuration question, or planned operational request.24/7 · Shared Slack or Teams channel or support ticket

Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.

Response means an on-call engineer is working the incident, not an automated reply.

Kubernetes scope

What does MariaDB on Kubernetes engineering include?

We cover mariadb-operator CRD design, anti-affinity and PodDisruptionBudget hardening, CSI block storage tuning, S3 PhysicalBackup pipelines, Prometheus observability, and 24/7 support.

  • mariadb-operator & Galera CRD architecture

    We design production-grade declarative manifests using the CNCF/MariaDB mariadb-operator for GitOps workflows.

    • 3-node Galera 4 CRDs with automated bootstrap and quorum recovery
    • MaxScale CRD integration for readwritesplit, causal_reads, and failover

    mariadb-operator · MariaDB CRD · MaxScale CRD · ArgoCD / Flux

    MariaDB Galera Cluster services
  • Anti-affinity, PDBs & QoS hardening

    Protect stateful database pods against Kubernetes node drains, spot evictions, and Linux OOMKiller events.

    • Strict zone anti-affinity and PodDisruptionBudget (maxUnavailable: 1)
    • Guaranteed QoS class sizing (requests == limits) matched to my.cnf buffers

    PodDisruptionBudget · podAntiAffinity · Guaranteed QoS · cgroups v2

  • CSI block storage & IOPS optimization

    Tune Kubernetes PersistentVolumeClaims and CSI drivers so InnoDB and Galera achieve bare-metal I/O consistency.

    • StorageClass design (EBS gp3/io2, GCP pd-ssd, Azure Premium SSD, OpenEBS)
    • WaitForFirstConsumer zone binding and online PVC volume expansion

    CSI StorageClass · WaitForFirstConsumer · allowVolumeExpansion

  • S3 PhysicalBackup & PITR automation

    Declarative backup and restore pipelines that survive an entire Kubernetes cluster or namespace deletion.

    • Scheduled PhysicalBackup CRDs using mariabackup streamed to S3/GCS/MinIO
    • Cross-namespace and cross-cluster Restore CRD drills to verify RTO

    PhysicalBackup CRD · Restore CRD · mariabackup · S3 object lock

  • Prometheus ServiceMonitor & PMM telemetry

    Full visibility into container cgroup limits, InnoDB metrics, and Galera wsrep state inside your Kubernetes observability stack.

    • mysqld_exporter sidecar and Prometheus Operator ServiceMonitor wiring
    • Pre-built Grafana dashboards and Alertmanager rules for Galera & InnoDB

    ServiceMonitor · mysqld_exporter · Grafana · PMM on Kubernetes

  • Rolling upgrades & 24/7 K8s support

    Safe Kubernetes worker node upgrades, MariaDB LTS image rollouts, and direct on-call incident response.

    • P1 response SLA: 15 mins, 24/7
    • MaxScale-drained rolling image upgrades from MariaDB 10.6 to 11.4 / 12.3 LTS

    kubectl · maxctrl · galera_recovery · cert-manager TLS

    MariaDB support services

StatefulSet behavior and written evidence

How mariadb-operator survives Kubernetes worker node drains

Generic Helm charts fail when kubelet drains a node or when cgroup memory limits clash with InnoDB. Proper CRDs, PDBs, and Guaranteed QoS keep the cluster online.

Three states of a MariaDB Galera cluster on Kubernetes

Select a state to compare a hardened mariadb-operator CRD against a naive Helm chart.

K8s Service -> MaxScale CRD -> MariaDB Galera StatefulSet

MaxScale pods route writes to mariadb-galera-0 and balance causal reads across mariadb-galera-1 and mariadb-galera-2.

3 AZs · Guaranteed QoS · Synced
  • mariadb-galera-0 (Zone A)

    Primary writer pod · EBS gp3 4,000 IOPS PVC

    Ready · Synced · QoS Guaranteed

  • mariadb-galera-1 (Zone B)

    Synced reader pod · Separate worker node via anti-affinity

    Ready · Synced · gcache=8G

  • mariadb-galera-2 (Zone C)

    Synced reader & PhysicalBackup donor pod

    Ready · Synced · PDB protected

Hard podAntiAffinity places each StatefulSet ordinal in a separate availability zone, while PodDisruptionBudget prevents concurrent evictions.

Example production MariaDB Galera CRD manifest on EKSSample deliverable

Kubernetes architecture specimen

Eliminated OOMKills and EKS node-upgrade quorum drops on a 3-node Galera cluster

Previously, monthly EKS AMI node rollouts caused Galera quorum loss because two pods shared a worker node and gcache.size was ephemeral. Moving to mariadb-operator with zone anti-affinity, maxUnavailable: 1, and Guaranteed 32Gi QoS made EKS node upgrades non-disruptive.

Pod OOMKills (90 days)6 → 0 events
EKS node drain rejoin11s (IST)

1. Production MariaDB Galera CRD with Guaranteed QoS & PDB

apiVersion: k8s.mariadb.com/v1alpha1
kind: MariaDB
metadata:
  name: mariadb-prod-galera
spec:
  image: mariadb:11.4.4
  replicas: 3
  galera:
    enabled: true
    providerOptions:
      gcache.size: "8G"
      gcache.recover: "yes"
      gcs.fc_limit: "128"
    sst: mariabackup
    recovery:
      enabled: true
  maxScale:
    enabled: true
  podDisruptionBudget:
    maxUnavailable: 1
  resources:
    requests: { cpu: "8", memory: "32Gi" }
    limits:   { cpu: "8", memory: "32Gi" }

2. Declarative S3 PhysicalBackup CRD with mariabackup

apiVersion: k8s.mariadb.com/v1alpha1
kind: PhysicalBackup
metadata:
  name: mariadb-prod-nightly
spec:
  mariaDbRef:
    name: mariadb-prod-galera
  schedule:
    cron: "0 2 * * *"
  maxRetention: 168h
  storage:
    s3:
      bucket: jusdb-prod-mariadb-backups
      endpoint: s3.us-east-1.amazonaws.com

Your team and ours

What managed Kubernetes services still leave to your team

Managed cloud databases automate much of the infrastructure layer, but your team still owns query performance, capacity, cost, and incident decisions.

Who handles each part of running MariaDB on Kubernetes across managed K8s providers versus JusDB engineering
AreaManaged K8s provider (EKS, GKE, AKS)Stateful DBRE engineering with JusDB
Managed Kubernetes control plane (EKS, GKE, AKS)AWS, Google Cloud, or Azure runs the Kubernetes API server and etcd.Your platform team runs OpenShift, Rancher, or bare-metal K8s.
mariadb-operator CRDs, Galera quorum, and MaxScale routingYours. Cloud K8s providers manage worker nodes, not stateful database operators or Galera quorum.Designed, deployed, and supported by JusDB engineers.
Pod QoS memory sizing vs innodb_buffer_pool_size (OOMKill prevention)Yours. Kubernetes immediately kills any pod whose RSS exceeds limits.memory.Calculated and tuned by JusDB so my.cnf fits safely inside cgroup limits.
CSI StorageClass tuning, anti-affinity, and PodDisruptionBudgetsDefault cloud storage classes use low baseline IOPS and Immediate binding.Hardened by JusDB with WaitForFirstConsumer, zone anti-affinity, and PDBs.
S3 PhysicalBackup CRDs and cross-namespace restore drillsCSI volume snapshots alone do not provide MariaDB binary log point-in-time recovery.Automated and restore-tested by JusDB using mariabackup and S3.

Your team keeps control

  • Set business priorities, application requirements, and release plans
  • Approve production changes, except routine actions you have pre-approved
  • Own your cloud accounts, access policies, and vendor relationships
  • Decide when maintenance can happen and how quickly service must recover
  • Move the work in-house or to another provider after your agreement's notice period, with your data returned or deleted and the transition help your agreement sets out (Terms, section 8)

JusDB handles the agreed K8s database work

  • Monitor database health, investigate alerts, and involve the right people
  • Review query performance, replication, capacity, and backup health
  • Carry out approved changes and update the operating instructions they affect
  • Report completed work, open risks, and recommended next steps

Kubernetes & MariaDB stack components

Compare options

How JusDB MariaDB on Kubernetes compares with generic Helm charts and RDS

Compare an engineered mariadb-operator Galera topology against basic Helm StatefulSets, cloud RDS lock-in, or running Kubernetes databases without DBRE cover.

Evaluation Vector
JusDB DBRE
In-House DBALegacy AgencyDeveloper Generalist
MariaDB Operator vs Custom Galera StatefulSetsDeploys the official Kubernetes MariaDB Operator with custom CRDs for MariaDB, MaxScale, and Backups, automating cluster bootstrap, state reconciliation, and self-healing.Maintains brittle manual StatefulSet manifests without custom controllers, requiring manual intervention for node joining and state recovery.Deploys generic unmaintained third-party Helm charts with hardcoded credentials and broken SST lifecycle hooks.Runs standalone single-pod MariaDB Deployments with ephemeral storage, losing all data upon container crash or node rescheduling.
Multi-AZ Pod Anti-Affinity & Rack TopologyConfigures strict topologySpreadConstraints, podAntiAffinity, and zone-aware Galera segment mappings across availability zones so the cluster keeps quorum through the loss of one AZ.Uses soft preferredDuringScheduling anti-affinity; scheduler co-locates multiple Galera pods on the same Kubernetes worker node during node drains.Ignores Kubernetes topology awareness entirely; all replicas schedule into a single zone, causing complete downtime during cloud zone outages.Does not configure node selectors or anti-affinity; multiple replicas land on resource-constrained development worker nodes.
Local NVMe StorageClasses & Persistent Volume ExpansionProvisions dedicated local NVMe StorageClasses with XFS filesystem tuning, volume expansion capabilities, and tuned I/O limits to prevent disk stalls during state transfers.Uses standard network-attached block storage (e.g., EBS gp2) with burstable IOPS, causing severe Galera flow control pauses during I/O starvation.Over-provisions monolithic cloud disks without volume expansion testing, forcing manual database downtime when storage capacity is exhausted.Uses default storage classes with hostPath volumes that break when pods reschedule to different Kubernetes nodes.
MaxScale Layer 7 In-Cluster Routing & Read/Write SplittingDeploys in-cluster MaxScale CRD instances with causal consistency, connection pooling, automated failover detection, and headless Kubernetes Service endpoints.Uses standard Kubernetes ClusterIP Service for round-robin load balancing, sending write queries to desynchronized or joiner nodes.Routes database traffic through external cloud load balancers or Ingress controllers, adding unnecessary network hops and connection drops.Directs application pods directly to pod IPs or a single pod DNS name, breaking whenever pods restart or scale.
PodDisruptionBudgets (PDB) & Low-Downtime Rolling UpgradesEnforces strict PodDisruptionBudgets (maxUnavailable=1) and automated preStop lifecycle hooks to coordinate Galera node drains during rolling upgrades.Performs cluster updates without PDBs; automated node pool upgrades drain multiple nodes simultaneously, destroying Galera cluster quorum.Performs manual kubectl delete pod commands without checking wsrep_local_state, triggering cluster-wide split-brain and downtime.Applies kubectl rollout restart statefulset blindly, taking down all cluster nodes simultaneously and corrupting grastate.dat.
Kubernetes Automated Backups, S3 Archival & PITR DrillsConfigures mariadb-operator Backup CRDs streaming encrypted mariabackup archives to S3/GCS with automated Cron schedules and continuous PITR drill validation.Relies on basic Kubernetes CronJobs executing mysqldump into PVC volumes without S3 offloading or point-in-time recovery capabilities.Uses container snapshot utilities that capture non-quiesced filesystems, producing corrupted InnoDB tablespaces upon restore.Relies solely on Kubernetes volume snapshots without database quiescing, failing consistency checks during recovery testing.

For procurement and security

NDA first, read-only by default, and written scope

We work alongside your platform and Kubernetes engineering teams. Your team approves every GitOps pull request and keeps all CRD YAML manifests, Helm values, and runbooks.Raguraman, Head of DBSRE · Allen D, Principal Engineer
  • Mutual NDA
  • Written statement of work
  • Named engineers
  • Least-privilege access
  • NDA before access

    Signed before any cluster access. The initial scoping call needs no kubeconfig or credentials.

  • Written agreement

    Target Kubernetes clusters, namespaces, deliverables, and fees agreed in writing.

  • Namespace-scoped RBAC

    Least-privilege Kubernetes RoleBindings scoped strictly to the database namespace, with audit logging.

  • Manifests you keep

    Every mariadb-operator CRD, StorageClass, and recovery runbook stays in your Git repository. Meet the JusDB team.

JusDB's security practices are aligned with ISO 27001 and SOC 2 Type II, and JusDB is pursuing both certifications (see Terms, section 12). Read the stated status.

FAQ

Common MariaDB on Kubernetes questions

Answers on mariadb-operator, OOMKill prevention, EKS/GKE worker node upgrades, CSI block storage, and S3 PhysicalBackup restores.

Still have a question?

Ask it on a scoping call. No production access needed.

Book a 30-min scoping call (opens Google Calendar in a new tab)

Is it safe to run production MariaDB and Galera Cluster on Kubernetes?

Yes, when engineered with the Kubernetes-native mariadb-operator, dedicated ReadWriteOnce CSI block storage (such as AWS EBS gp3/io2, GCP pd-ssd, or local NVMe), Guaranteed Pod QoS (requests equal limits), strict zone podAntiAffinity, and PodDisruptionBudgets. Most Kubernetes database outages happen when teams use generic Helm charts without wsrep-aware probes or cgroup-matched memory limits.

How do you prevent Kubernetes OOMKiller (Exit Code 137) from killing MariaDB pods?

Kubernetes terminates a pod immediately if its resident memory exceeds resources.limits.memory. We assign Guaranteed QoS, size innodb_buffer_pool_size to 65–70% of the pod memory limit (leaving headroom for Galera gcache, Aria cache, performance_schema, and connection buffers), and enable thread_handling=pool-of-threads to cap per-thread memory growth.

What happens to a MariaDB Galera Cluster when Kubernetes upgrades worker nodes?

With a PodDisruptionBudget set to maxUnavailable: 1 and hard podAntiAffinity across availability zones, kubelet can only drain one MariaDB pod at a time. MaxScale drains active connections from that pod, the pod reschedules with its persistent PVC, catches up in seconds via Galera Incremental State Transfer (IST), and only after the cluster returns to 3/3 Synced does Kubernetes drain the next node.

How does mariadb-operator handle full cluster recovery if all pods stop?

Unlike a raw StatefulSet that deadlocks on safe_to_bootstrap: 0 after a cluster-wide power loss, mariadb-operator runs recovery jobs across each pod's PVC to inspect the highest committed GTID sequence number (seqno), bootstraps the most advanced pod automatically, and rejoins the remaining replicas.

Which Kubernetes storage classes do you recommend for MariaDB?

Always use block-backed ReadWriteOnce storage classes with volumeBindingMode: WaitForFirstConsumer and allowVolumeExpansion: true. On AWS EKS we use EBS gp3 or io2; on GKE we use pd-ssd or Hyperdisk Balanced; on AKS we use Premium SSD v2; and on bare-metal Kubernetes we use local NVMe with Rook-Ceph RBD or OpenEBS Mayastor. Never use NFS or AWS EFS for InnoDB data directories.

How do backups and point-in-time recovery work for MariaDB on Kubernetes?

We configure mariadb-operator PhysicalBackup CRDs (running mariabackup on a non-writer replica) combined with binary log archiving to S3-compatible object storage with bucket versioning. This allows declarative Restore CRDs to hydrate a point-in-time clone into any namespace or standby cluster.

What are your SLA response times if a Kubernetes MariaDB cluster has an outage?

24/7 support. SLA response times: P1 – 15 mins | P2 – 30 mins | P3 – 60 mins. Our engineering team is in India (IST, UTC+5:30) and provides 24/7 support.

Can you migrate our existing VM or RDS MariaDB database onto Kubernetes?

Yes. We deploy the target mariadb-operator cluster in Kubernetes, establish continuous GTID replication from your existing VM or RDS primary into the Kubernetes cluster, verify data parity with pt-table-checksum, and switch application traffic over via MaxScale or ExternalName services.

MariaDB and Galera playbooks

MariaDB clustering, proxy, and operational guides

Practical guides from our engineering team on Galera 4 quorum, wsrep tuning, MaxScale routing, and MariaDB vs MySQL.

Next step

Talk to a Kubernetes DBRE about your MariaDB StatefulSets

Tell us which Kubernetes platform, CSI storage driver, and MariaDB topology you run or plan to deploy. The first 30-minute call covers your databases, current ownership, and required coverage. No production access is needed. Or request a free audit of one database instance, subject to availability: mutual NDA before read-only access, a prioritized report within one week after access is ready, and no obligation.

NDA before access · read-only by default · written scope first