I've successfully deployed in Kubernetes a InnoDB Cluster
via mysql-operator
and I've also set up the scheduled backup. I'm also able to init the DB via the same backup created by InnoDB.
However I can't find a way to init the DB the first time by importing a simple logical backup which is defined by a simple .sql
script.
Is it possible to achieve that via mysql-operator or via InnoDB kubernetes manifest? Possible alternatives?
Relevant documentation:
- operator reference schema: https://dev.mysql.com/doc/mysql-operator/en/mysql-operator-properties.html
- dump doc: https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-dump-instance-schema.html
- load-dump doc: https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-utilities-load-dump.html
InnoDBCluster manifest:
apiVersion: mysql.oracle.com/v2
kind: InnoDBCluster
metadata:
name: mysql-cluster
namespace: cr-platform
spec:
secretName: mysql-root-user
instances: 2
tlsUseSelfSigned: true
router:
instances: 1
backupSchedules:
- name: daily-2300
enabled: true
schedule: "0 23 * * *"
backupProfileName: s3-backup
backupProfiles:
- name: s3-backup
dumpInstance:
dumpOptions:
chunking: false
storage:
s3:
bucketName: al-mysql
prefix: /backup
config: s3-secret
profile: default
endpoint: https://s3-endpoint
## Restore from InnoDB dump but not from .sql script
initDB:
dump:
dumpOptions:
dryRun: false
storage:
# backup
s3:
bucketName: al-mysql
prefix: /init
config: s3-secret
profile: default
endpoint: https://s3-endpoint