From dfc2c7c6c9c60349258b8c67c8108b2e3cb95dd1 Mon Sep 17 00:00:00 2001 From: samarthyagupta Date: Wed, 20 Dec 2023 17:06:17 +0530 Subject: [PATCH 1/5] Sizing updates for Mysql --- intent_types/mysql/v1alpha1/sample.json | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/intent_types/mysql/v1alpha1/sample.json b/intent_types/mysql/v1alpha1/sample.json index 3561f49..8f82309 100644 --- a/intent_types/mysql/v1alpha1/sample.json +++ b/intent_types/mysql/v1alpha1/sample.json @@ -16,6 +16,11 @@ "max_connections": "1000", "query_cache_size": "0" }, + "size": { + "cpu": "100m", + "memory": "100Mi", + "volume": "50G" + }, "replication": { "enabled": true, "type": "master-slave", @@ -27,5 +32,11 @@ "version": "1.0", "name": "standard" }, - "advanced": {} -} + "advanced": { + "backup":{ + "enabled":false, + "backup_window":"0 0 * * 7" + }, + "monitoring": true + } +} \ No newline at end of file From 4045832283b0b600ac8906f638a42afaf7c6cf4d Mon Sep 17 00:00:00 2001 From: samarthyagupta Date: Wed, 20 Dec 2023 17:53:02 +0530 Subject: [PATCH 2/5] Backup Retention Duration --- intent_types/mysql/v1alpha1/sample.json | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/intent_types/mysql/v1alpha1/sample.json b/intent_types/mysql/v1alpha1/sample.json index 8f82309..98957fb 100644 --- a/intent_types/mysql/v1alpha1/sample.json +++ b/intent_types/mysql/v1alpha1/sample.json @@ -18,9 +18,9 @@ }, "size": { "cpu": "100m", - "memory": "100Mi", - "volume": "50G" + "memory": "100Mi" }, + "volume": "50G", "replication": { "enabled": true, "type": "master-slave", @@ -33,10 +33,13 @@ "name": "standard" }, "advanced": { - "backup":{ - "enabled":false, - "backup_window":"0 0 * * 7" - }, - "monitoring": true + "common":{ + "backup":{ + "enabled":false, + "backup_window":"0 0 * * 7", + "retention":"30" + }, + "monitoring": true + } } } \ No newline at end of file From 4401e0c14c2f46b4accf78fdfc2d8ac193c29d01 Mon Sep 17 00:00:00 2001 From: samarthyagupta Date: Wed, 20 Dec 2023 18:24:45 +0530 Subject: [PATCH 3/5] Removed Sizing and added more fields to backup --- intent_types/mysql/v1alpha1/sample.json | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/intent_types/mysql/v1alpha1/sample.json b/intent_types/mysql/v1alpha1/sample.json index 98957fb..96a3bdd 100644 --- a/intent_types/mysql/v1alpha1/sample.json +++ b/intent_types/mysql/v1alpha1/sample.json @@ -16,15 +16,19 @@ "max_connections": "1000", "query_cache_size": "0" }, - "size": { - "cpu": "100m", - "memory": "100Mi" - }, - "volume": "50G", "replication": { "enabled": true, "type": "master-slave", "replica_count": 2 + }, + "backup": { + "enabled": false, + "frequency": "0 0 * * 7", + "retention": "30", + "storage":{ + "type":"nfs", + "path":"/path/to/backups" + } } }, "disabled": false, @@ -32,14 +36,5 @@ "version": "1.0", "name": "standard" }, - "advanced": { - "common":{ - "backup":{ - "enabled":false, - "backup_window":"0 0 * * 7", - "retention":"30" - }, - "monitoring": true - } - } + "advanced": {} } \ No newline at end of file From 1f6c543907af809b3d751dff92b2b952a18cac0a Mon Sep 17 00:00:00 2001 From: samarthyagupta Date: Wed, 20 Dec 2023 18:40:18 +0530 Subject: [PATCH 4/5] Removed storage field and updated schema --- intent_types/mysql/v1alpha1/sample.json | 8 ++------ intent_types/mysql/v1alpha1/schema.json | 10 ++++++++++ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/intent_types/mysql/v1alpha1/sample.json b/intent_types/mysql/v1alpha1/sample.json index 96a3bdd..de3c42c 100644 --- a/intent_types/mysql/v1alpha1/sample.json +++ b/intent_types/mysql/v1alpha1/sample.json @@ -23,12 +23,8 @@ }, "backup": { "enabled": false, - "frequency": "0 0 * * 7", - "retention": "30", - "storage":{ - "type":"nfs", - "path":"/path/to/backups" - } + "frequency": "7", + "retention": "30" } }, "disabled": false, diff --git a/intent_types/mysql/v1alpha1/schema.json b/intent_types/mysql/v1alpha1/schema.json index 6009c52..6620335 100644 --- a/intent_types/mysql/v1alpha1/schema.json +++ b/intent_types/mysql/v1alpha1/schema.json @@ -40,6 +40,16 @@ "enabled": {"type": "boolean"}, "type": {"type": "string"}, "replica_count": {"type": "integer"} + }, + "backup": { + "type": "object", + "description": "Optional backup configuration for mysql server.", + "properties": { + "enabled": {"type": "boolean", "description":"set true to enable backup"}, + "frequency":{"type": "number", "description":"backup frequency"}, + "retention": {"type": "number","description":"Number of days the data will be persistent"} + + } } } } From baa3f7c036a1075785297cc3fd4a6d7f933c40ee Mon Sep 17 00:00:00 2001 From: samarthyagupta Date: Thu, 21 Dec 2023 11:34:03 +0530 Subject: [PATCH 5/5] Updated Readme for backup and repication fields --- intent_types/mysql/v1alpha1/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/intent_types/mysql/v1alpha1/README.md b/intent_types/mysql/v1alpha1/README.md index c4eaba6..b548217 100644 --- a/intent_types/mysql/v1alpha1/README.md +++ b/intent_types/mysql/v1alpha1/README.md @@ -17,7 +17,8 @@ This intent type is designed to represent a MySQL database configuration within In the `spec` object: - `version`: Specifies the MySQL version (e.g., `5.7`, `8.0`). - `server_variables`: An optional field for specifying MySQL server variables as a map of key-value pairs (e.g., `max_connections: "1000"`). - +- `replication`: Specifies the master-reader/master-master relation and their replication(s). +- `backup`: Specifies the backup frequency and retention details in days. ## Example See the `sample.json` file for an example instance of this intent type. \ No newline at end of file