pxc-operator

by Percona

Helm chartv1.20.1App 1.20.0

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:

ParameterDescriptionDefault
imagePXC Operator Container image full pathpercona/percona-xtradb-cluster-operator:1.20.0
imagePullPolicyPXC Operator Container pull policyIfNotPresent
containerSecurityContextPXC Operator Container securityContext{}
imagePullSecretsPXC Operator Pod pull secret[]
replicaCountPXC Operator Pod quantity1
tolerationsList of node taints to tolerate[]
podAnnotationsOperator Pod user-defined annotations{}
resourcesResource requests and limits{}
nodeSelectorLabels for Pod assignment{}
logStructuredForce PXC operator to print JSON-wrapped log messagesfalse
logLevelPXC Operator logging levelINFO
disableTelemetryDisable sending PXC Operator telemetry data to Perconafalse
maxConcurrentReconcilesLimits the number of parallel cluster reconciles1
s3WorkersLimitAdjusts the maximum number of parallel workers used for S3 client10
watchAllNamespacesWatch all namespaces (Install cluster-wide)false
watchNamespaceComma separated list of namespace(s) to watch when different from release namespace""
createNamespaceCreate the watched namespace(s)false
rbac.createIf false RBAC will not be created. RBAC resources will need to be created manuallytrue
serviceAccount.createIf false the ServiceAccounts will not be created. The ServiceAccounts must be created manuallytrue
extraEnvVarsCustom pod environment variables[]
featureGates.xtrabackupSidecarEnable the Xtrabackup Sidecar featurefalse
leaderElectionEnabledEnable leader election for the operator (ensures only one active instance)true
leaseNameCustom lease name for leader election (must be a valid DNS subdomain); uses operator name if empty""
leaseDurationDuration that non-leader candidates wait before forcing leader acquisition60s
renewDeadlineDuration the acting leader retries refreshing its leadership before giving up40s
retryPeriodDuration clients should wait between attempts to acquire or renew the leader lease10s

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 SupportCommunity 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 SupportVisit 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartpxc-operator is pinned at v1.20.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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