Files
cozystack/packages/apps/mysql
Timofei Larkin bd9e283d3b [platform] Always set resources for managed apps
This patch removes the loophole to leave resource requests and limits
unspecified in managed apps. Any of cpu, memory, and ephemeral storage
are now filled in from the resource preset (default or user-specified)
if not explicitly specified in .Values.resources. "none" is no longer an
accepted value in resourcePresets and the primary resources now always
have some explicit value for proper billing and isolation.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
2025-07-03 17:45:32 +03:00
..
2025-06-24 23:07:51 +00:00
2024-08-12 14:47:11 +02:00
2024-07-16 17:31:52 +02:00
2025-06-24 17:35:26 +02:00
2025-06-24 17:35:26 +02:00

Managed MariaDB Service

The Managed MariaDB Service offers a powerful and widely used relational database solution. This service allows you to create and manage a replicated MariaDB cluster seamlessly.

Deployment Details

This managed service is controlled by mariadb-operator, ensuring efficient management and seamless operation.

HowTos

How to switch master/slave replica

kubectl edit mariadb <instnace>

update:

spec:
  replication:
    primary:
      podIndex: 1

check status:

NAME        READY   STATUS    PRIMARY POD   AGE
<instance>  True    Running   app-db1-1     41d

How to restore backup:

find snapshot:

restic -r s3:s3.example.org/mariadb-backups/database_name snapshots

restore:

restic -r s3:s3.example.org/mariadb-backups/database_name restore latest --target /tmp/

more details:

Known issues

  • Replication can't not be finished with various errors

  • Replication can't be finised in case if binlog purged Until mariadbbackup is not used to bootstrap a node by mariadb-operator (this feature is not inmplemented yet), follow these manual steps to fix it: https://github.com/mariadb-operator/mariadb-operator/issues/141#issuecomment-1804760231

  • Corrupted indicies Sometimes some indecies can be corrupted on master replica, you can recover them from slave:

    mysqldump -h <slave> -P 3306 -u<user> -p<password> --column-statistics=0 <database> <table> ~/tmp/fix-table.sql
    mysql -h <master> -P 3306 -u<user> -p<password> <database> < ~/tmp/fix-table.sql
    

Parameters

Common parameters

Name Description Value
external Enable external access from outside the cluster false
size Persistent Volume size 10Gi
replicas Number of MariaDB replicas 2
storageClass StorageClass used to store the data ""

Configuration parameters

Name Description Value
users Users configuration {}
databases Databases configuration {}

Backup parameters

Name Description Value
backup.enabled Enable pereiodic backups false
backup.s3Region The AWS S3 region where backups are stored us-east-1
backup.s3Bucket The S3 bucket used for storing backups s3.example.org/postgres-backups
backup.schedule Cron schedule for automated backups 0 2 * * *
backup.cleanupStrategy The strategy for cleaning up old backups --keep-last=3 --keep-daily=3 --keep-within-weekly=1m
backup.s3AccessKey The access key for S3, used for authentication oobaiRus9pah8PhohL1ThaeTa4UVa7gu
backup.s3SecretKey The secret key for S3, used for authentication ju3eum4dekeich9ahM1te8waeGai0oog
backup.resticPassword The password for Restic backup encryption ChaXoveekoh6eigh4siesheeda2quai0
resources Resources {}
resourcesPreset Use a common resources preset when resources is not set explicitly. (allowed values: none, nano, micro, small, medium, large, xlarge, 2xlarge) nano