pxc-operator
by Percona
A Helm chart for deploying the Percona Operator for MySQL (based on Percona XtraDB Cluster)
About this chart
Percona Operator For MySQL
Percona XtraDB Cluster (PXC) is a database clustering solution for MySQL. Percona Operator For MySQL allows users to deploy and manage Percona XtraDB Clusters on Kubernetes.
Useful links
Pre-requisites
- Kubernetes 1.30+
- Helm v3
Installation
This chart will deploy the Operator Pod for the further Percona XtraDB Cluster creation in Kubernetes.
Installing the Chart
To install the chart with the pxc release name using a dedicated namespace (recommended):
helm repo add percona https://percona.github.io/percona-helm-charts/
helm install my-operator percona/pxc-operator --version 1.20.0 --namespace my-namespace
The chart can be customized using the following configurable parameters:
| Parameter | Description | Default |
|---|---|---|
image | PXC Operator Container image full path | percona/percona-xtradb-cluster-operator:1.20.0 |
imagePullPolicy | PXC Operator Container pull policy | IfNotPresent |
containerSecurityContext | PXC Operator Container securityContext | {} |
imagePullSecrets | PXC Operator Pod pull secret | [] |
replicaCount | PXC Operator Pod quantity | 1 |
tolerations | List of node taints to tolerate | [] |
podAnnotations | Operator Pod user-defined annotations | {} |
resources | Resource requests and limits | {} |
nodeSelector | Labels for Pod assignment | {} |
logStructured | Force PXC operator to print JSON-wrapped log messages | false |
logLevel | PXC Operator logging level | INFO |
disableTelemetry | Disable sending PXC Operator telemetry data to Percona | false |
maxConcurrentReconciles | Limits the number of parallel cluster reconciles | 1 |
s3WorkersLimit | Adjusts the maximum number of parallel workers used for S3 client | 10 |
watchAllNamespaces | Watch all namespaces (Install cluster-wide) | false |
watchNamespace | Comma separated list of namespace(s) to watch when different from release namespace | "" |
createNamespace | Create the watched namespace(s) | false |
rbac.create | If false RBAC will not be created. RBAC resources will need to be created manually | true |
serviceAccount.create | If false the ServiceAccounts will not be created. The ServiceAccounts must be created manually | true |
extraEnvVars | Custom pod environment variables | [] |
featureGates.xtrabackupSidecar | Enable the Xtrabackup Sidecar feature | false |
leaderElectionEnabled | Enable leader election for the operator (ensures only one active instance) | true |
leaseName | Custom lease name for leader election (must be a valid DNS subdomain); uses operator name if empty | "" |
leaseDuration | Duration that non-leader candidates wait before forcing leader acquisition | 60s |
renewDeadline | Duration the acting leader retries refreshing its leadership before giving up | 40s |
retryPeriod | Duration clients should wait between attempts to acquire or renew the leader lease | 10s |
Specify parameters using --set key=value[,key=value] argument to helm install
Alternatively a YAML file that specifies the values for the parameters can be provided like this:
helm install pxc-operator -f values.yaml percona/pxc-operator
Unit Tests
Helm unit tests for operator charts use the helm-unittest plugin.
Install the plugin from the repository root:
make helm-unittest
Unit tests for this chart live under charts/pxc-operator/tests/ and validate
the rendered operator manifests. Prefer focused tests: start with the default
rendered structure, then add one test per optional or conditional value to
verify that setting the value in values.yaml renders the expected field.
Run this chart's unit tests with:
make test-pxc-operator
The HELM variable can be overridden when a different Helm binary is needed:
make HELM=/path/to/helm test-pxc-operator
Deploy the database
To deploy Percona XtraDB Cluster run the following command:
helm install my-db percona/pxc-db
See more about Percona XtraDB Cluster in its chart here or in the Helm chart installation guide.
Need help?
| Commercial Support | Community Support |
|---|---|
| Enterprise-grade assistance for your mission-critical database deployments in containers and Kubernetes. Get expert guidance for complex tasks like multi-cloud replication, database migration and building platforms. | Connect with our engineers and fellow users for general questions, troubleshooting, and sharing feedback and ideas. |
| Get Percona Support | Visit our Forum |
Deploy pxc-operator with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pxc-operator on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartpxc-operator is pinned at v1.20.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply