12.01.2026

Percona XtraDB Cluster Operator: Highly Available MySQL on Kubernetes

Modern applications demand databases that are not only performant, but also highly available, scalable, and easy to operate. Managing MySQL clusters manually in Kubernetes can be complex and error-prone, especially when it comes to replication, failover, backups, and upgrades.
Percona XtraDB Cluster Operator solves these problems by automating the deployment and lifecycle management of MySQL clusters based on Percona XtraDB Cluster (PXC) inside Kubernetes.

This article explains what the operator is, how it works, where it is useful in practice, how to install it, and answers common questions.

What is Percona XtraDB Cluster Operator?

Percona XtraDB Cluster Operator is a Kubernetes Operator that automates the creation, configuration, and management of Percona XtraDB Cluster (PXC) — a highly available MySQL-compatible database solution based on synchronous replication (Galera).

The operator follows the Kubernetes Operator pattern:

  1. You describe the desired database state using Custom Resource Definitions (CRDs)
  2. The operator continuously ensures that the actual cluster state matches this desired configuration

Key features include:

GitHub repository:
https://github.com/percona/percona-xtradb-cluster-operator

Why Use Percona XtraDB Cluster Operator?

Running MySQL in Kubernetes without an operator usually means:

The operator abstracts all this complexity and provides:

It is especially useful for teams adopting Kubernetes but still relying heavily on relational databases.

Practical Use Cases

1. Highly Available MySQL for Microservices

A typical microservices architecture often relies on multiple backend services accessing the same database. With Percona XtraDB Cluster, multiple MySQL nodes run simultaneously while write operations are synchronously replicated across all nodes. If one pod fails, traffic is automatically redirected to healthy nodes, ensuring continuous availability. This approach significantly minimizes downtime and prevents data inconsistency in distributed systems.

2. Automated Backups and Disaster Recovery

The operator supports scheduled backups to S3-compatible storage as well as on-demand backups, allowing teams to protect data without manual intervention. With proper configuration, point-in-time recovery is also available, making it possible to restore the database to a specific moment in time. These capabilities are especially useful in scenarios such as recovering from accidental data deletion, restoring databases into new Kubernetes clusters, or cloning environments from production to staging.

3. Scaling Database Clusters

Scaling is performed declaratively by adjusting the number of PXC nodes defined in the Custom Resource. The operator safely manages the process of adding or removing nodes, ensuring cluster stability and data consistency. This approach is particularly useful during traffic spikes, seasonal load increases, or gradual capacity planning as application demands grow.

4. Safe Upgrades and Maintenance

The operator supports rolling upgrades by updating cluster nodes one by one while keeping the database available throughout the process. This ensures that cluster availability is preserved and eliminates the need for manual intervention. As a result, operational risk during MySQL or Kubernetes version upgrades is significantly reduced.

Installation Guide

Below is a simplified installation flow. Full production setups may require additional tuning.

Prerequisites:

  1. Kubernetes cluster (v1.22+ recommended)
  2. kubectl installed
  3. Helm (optional but recommended)
  4. Persistent storage configured

Step 1: Clone the Repository (Optional)

git clone https://github.com/percona/percona-xtradb-cluster-operator.git
cd percona-xtradb-cluster-operator

Step 2: Install the Operator

Using manifests:

kubectl apply -f deploy/bundle.yaml

Or using Helm (recommended):

helm repo add percona https://percona.github.io/percona-helm-charts/
helm repo update
helm install pxc-operator percona/pxc-operator

Step 3: Deploy a MySQL Cluster

Create a Custom Resource, for example:

apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBCluster
metadata:
name: my-cluster
spec:
pxc:
size: 3
image: percona/percona-xtradb-cluster:8.0
haproxy:
enabled: true
size: 2

Apply it:

kubectl apply -f cluster.yaml

The operator will:

  1. Create pods
  2. Configure replication
  3. Expose services
  4. Ensure cluster health

Frequently Asked Questions (FAQ)

Conclusion

Percona XtraDB Cluster Operator is a powerful, production-ready solution for running highly available MySQL on Kubernetes. It removes much of the operational burden traditionally associated with database clusters and replaces it with a declarative, automated, and cloud-native approach.

If your project requires strong consistency, high availability, automated operations, aubernetes-native workflows

Then Percona XtraDB Cluster Operator is a solid and proven choice.

For more details, examples, and advanced configurations, visit the official GitHub repository:
https://github.com/percona/percona-xtradb-cluster-operator