Adopt an existing MySQL data volume

Description:

I’m trying to setup an async replicated cluster using the operator 0.7.0.

I already have a standalone MySQL instance in the same cloud environment (openstack) as the k8s cluster where the operator is running. Therefore I would like to reuse the data volume that contains already 2+TB worth of tables. I was able to setup everything so that the PVC created by the operator is bound to the already existing data volume however I’m facing the following problems:

  • the data volume contains all the MySQL data in /data subpath, how can I configure the percona MySQL server to use /var/lib/mysql/data as datadir? I’ve tried to use a configmap specifying the datadir option in [mysqld] section but when the first pod is created it ignores it and tries to bootstrap a new MySQL instance under /var/lib/mysql

  • Curiously enough after the initialization is over the mysqld restarts and it uses the correct datadir however after a recovery procedure the daemon fails with the following error:

2024-04-09T11:47:25.083094Z 0 [ERROR] [MY-011685] [Repl] Plugin group_replication reported: ‘The group_replication_group_name option is mandatory’
2024-04-09T11:47:25.083122Z 0 [ERROR] [MY-011660] [Repl] Plugin group_replication reported: ‘Unable to start Group Replication on boot’

Which I don’t really understand since I’ve configured the cluster to be of type async which should not use group replication.

Additional Information

I should mention that I have tested the data volume with a standalone pod using the percona server image mounting it with subPath: data and it is working fine. So the question is whether I can somehow configure the operator to pickup such volume. Any help or insight would be really useful.