The source code and default configuration of the Building Block is available in our code.sysEleven.de.
The PXC Operator (Percona XtraDB Cluster) is an open source enterprise MySQL solution.
Infos on release notes and new features please follow Release notes pxc-operator
This building block will deploy a Percona XtraDB cluster with HAProxy as a load balancing frontend.
Using the supplied configuration possibilities, you can configure all settings for the cluster itself as well as manage databases and users inside the cluster.
In version 1.1.0 of this building block we changed that the volumes of the database will be retained even if
the perconaxtradbclusters.pxc.percona.com
resource is deleted
You need to provide a storage provider for this Building Block. Proceed with the following prerequisite description to use the Velero Building Block out of the box.
A recommended resource overview is listed in the table below.
CPU / vCPU | Memory |
---|---|
6.7 | 9728MiB |
No further activities need to be carried out in advance.
Add the directory syseleven-pxc-operator
to your control repository. Add a .gitlab-ci.yml
to the directory with the following content:
include:
- project: syseleven/building-blocks/helmfiles/pxc-operator
file: JobDevelopment.yaml
ref: 3.50.3
- project: syseleven/building-blocks/helmfiles/pxc-operator
file: JobStaging.yaml
ref: 3.50.3
- project: syseleven/building-blocks/helmfiles/pxc-operator
file: JobProduction.yaml
ref: 3.50.3
Remove environments you are not using by removing their include.
The building block consists of multiple helm charts that can be configure individually.
Look at the helmfile.yaml in the releases.[].values
section. The configuration of each helm chart can be overriden in those files in the specified hierarchy.
There are some default values that the building block will set for the upstream helm chart.
Set the following sections in one of those files:
values-pxc-db.yaml
values-pxc-db-$ENVIRONMENT.yaml
You have to set
backup:
storages:
s3:
s3:
credentialsAccessKey: ...
credentialsSecretKey: ...
If you can't, please disable the backup schedule with
backup:
schedule: []
You have to set the following variables otherwise they will be changed on every run.
secrets:
passwords:
root: ...
xtrabackup: ...
monitor: ...
clustercheck: ...
proxyadmin: ...
pmmserver: ...
operator: ...
replication: ...
Specify your values in the following helm values files:
values-mysql-config.yaml
values-mysql-config-${ENVIRONMENT}.yaml
The following table lists the configurable parameters for the management of the mysql-config chart and their default values.
Parameter | Description | Default |
---|---|---|
schedule |
The cron schedule for the job that creates the users and databases | */15 * * * * |
target.host |
The MySQL server on which to manage databases and users | pxc-db-haproxy |
target.user |
The user with which users and databases are created | root |
target.existingSecret |
The password for target.user |
"pxc-db" |
target.existingSecretKey |
The key in target.existingSecret where the password for target.user is stored |
"root" |
databases |
The databases to manage. See configuration for details | [] |
users |
The users to manage. See configuration for details | [] |
Default parameters like e.g. the image
and tolerations
are available, too. See the values.yaml file for those parameters.
The user and database creation is done with ansible, so you can specify any parameters that the ansible modules support. See
Example:
databases:
- name: forms
state: present
- name: web
encoding: utf8mb4
state: present
users:
- name: 'web'
host: '%'
# We recommend using already hashed passwords. Please check the notes in the ansible module for the supported hash modules
password: '*94BDCEBE19083CINVALIDEFD02F964C7AF3CFC29'
priv: 'web.*:ALL'
state: present
- name: 'old_user'
host: '%'
password: '*94BDCEBE19083CINVALIDEFD02F964CFOOO21319'
priv: 'web.*:ALL'
state: absent
This Building Blocks ships a cronjob that deletes s3 backup files older than a certain age (default 14d
).
By default, PXC-operator does not cleanup backup files stored in s3 (see).
This might lead to saturation of your S3 quota and other applications using this quota might break.
You can disable this cronjob by setting backupcleanup.enabled=false
in pxc-db-*.yaml
. See pxc-operator-extension/values.yaml for further configuration options and default values.
You have to deploy a local storage class provisioner or change pxc.persistence.storageClass
. A possible local storage class provisoner is local-path-provisioner.
See how to use pxc-operator with local storage for more information
Version 3.40.0 has a mismatch on the pxc.SecretName, which is used to distribute the credentials on the cluster deployment.
This is fixed on version 3.40.1.
As a workaround on version 3.40.0, you can specify the common name via the values-pxc-db.yaml
or corresponding environment-files by adding the following values:
pxc:
clusterSecretName: pxc-db
Please check if this bucket already exists. Object storage buckets need to be unique within a region.
This building block consists of multiple components. Each of the components can and must be scaled individually.
Please find more infos on release notes and new features Release notes PXC Operator