Package: kmm4g
Kubernetes MySQL Manager for GIG based clouds.IntroductionTheKMM4Gscript uses theMySQL Operator Kubernetes Controllerthat can be installed into any existing Kubernetes cluster hosted onGIG based clouds. Once installed, it will enable users to create and manage production-ready MySQL clusters using a simple declarative configuration format.Common operational tasks such as backing up databases and restoring from an existing backup are made extremely easy. In short, theKMM4Gabstracts away the hard work of running MySQL inside Kubernetes.This script runs onKubernetes Clustersthat are hosted onGIG based cloudswhich offers IaaS and S3 Cloud for private and public use cases. CheckGIG based cloudsto learn more about what they offer.Pre-InstallingYou need to have aKubernetes ClusterwithContainer Storage Interface (CSI)which is offered byGIG based clouds.Object storage (S3) provided byGIG based cloudsto store and restore backups.You need to haveHelm Chartsversion 3 installed on your machine.Installation Guidepip install kmm4gRun commandkmm4gScript FunctionsInstall MySQL-OperatorCreate MySQL-ClusterCreate Cluster From Existing BackupList Your ClustersEdit ClusterRemove ClusterList BackupsExitStep-by-Step GuideIf you are installing the script for the first time, you need to choose"Install MySQL-Operator"option. This command will configure and set upMySQL-Operatorwith the needed packages on yourKubernetes Clusters. If you haveMySQL-Operatorinstalled on yourKubernetes Clusters, then you won't be able to install it again.Create MySQL-ClusterYou can select this option if you want to create a newMySQL-Cluster. Then you will need to enter yourMySQL Clusterdata.InputValueJWTYour JWT token provided on yourGIG based clouds Account.API URLYourGIG based clouds API URL(e.g cloud.gig.tech/api/1)Customer IDYourGIG based cloudsCustomer_IDprovided in yourGIG based clouds Accountand also in yourCloudspace URL.CloudSpace IDThe ID of yourGIG based cloudsspacethat contains yourKubernetes Cluster, you can find it in yourCloudspace URL.Cluster NameThe name of yourMySQL Cluster(feel free to name it as you like).Number of ReplicasNumber of replicas of yourMySQL Cluster.Root PasswordThe root password of yourMySQL Cluster.MySQL NodePort[30000-32767]The port to access yourMySQL Cluster(please select a port between 30000-32767 and make sure that this port isn't used before).Cluster Size (Gi)YourMySQL Clustersize inGigaBytes.Enable Auto Backup ?[yes/no]Select whether you want to enableauto backupor not.Backup Schedule[daily/weekly/monthly/yearly/custom]If you enabledauto backup, then you will need to add a schedule for your backup whether daily, weekly, monthly, yearly or even custom.Custom Backup CronjobIf you selected custom schedule, then you need to set the backup cronjob. Learn more about writing custom cronjobs checkMySQL Operator Repo.Number of Backups LimitThe maximum number of backups to be saved (e.g if the limit is 5 then the latest 5 backups will be saved and the older versions will be deleted automatically).Object Storage EndpointThe domain of your object storage without addinghttporhttps(e.g example.com).Object Storage PortThe port that you will use to access your object storage.Object Storage Access KeyThe access key for your object storage, you cand find it onGIG based clouds Portal.Object Storage Secret KeyThe secret key for your object storage, you cand find it onGIG based clouds Portal.Bucket NameEnter your bucket name (If you entered a name ofexisting bucketthe script will use it. However, if you entered a new name that isn't used before the script willcreate a bucketwith the new name for you then use it).For every finished operation you will receive a couple of confirmation messages. At the end, you'll have yourMySQL Clusterconfigured.Objectstorageconnected
Bucket<BUCKET_NAME>hasbeencreated
Creatingserverpool...
ServerPoolStatus200Addkuberneteshoststoserverpool...
<KUBERNETES_HOSTS_LIST>
AddhoststoServerPoolStatus200CreatingLoadBalancer...
<LOAD_BALANCER_ID>
Deployingyourclusterwithautobackup...
NAME:<CLUSTER_NAME>
LASTDEPLOYED:<DEPLOYMENT_DATE_TIME>
NAMESPACE:default
STATUS:deployed
REVISION:1TESTSUITE:None

Pleasewaituntiltheclusterbecomesready...
Accessyourclusterwithport<MYSQL_NODE_PORT>You can test whether yourMySQL Clusteris ready or not using this commandkubectl get pod | grep <CLUSTER_NAME>.Adittionally, to access yourMySQL Clusteruse this commandmysql -uroot -p -h <CLOUDSPACE_PUBLIC_IP> -P <CLUSTER_PORT>.Create Cluster From Existing BackupYou can select this option if you want to create a new MySQL-Cluster from an existing backup. Then you will need to enter yourMySQL Clusterdata and the usedBackupdata.InputValueJWTYour JWT token provided on yourGIG based clouds Account.API URLYourGIG based clouds API URL(e.g cloud.gig.tech/api/1)Customer IDYourGIG based cloudsCustomer_IDprovided in yourGIG based clouds Accountand also in yourCloudspace URL.CloudSpace IDThe ID of yourGIG based cloudsspacethat contains yourKubernetes Cluster, you can find it in yourCloudspace URL.Cluster NameThe name of yourMySQL Cluster(feel free to name it as you like).Number of ReplicasNumber of replicas of yourMySQL Cluster.Root PasswordThe root password of yourMySQL Cluster. (Should be the same root password as your backup)MySQL NodePort[30000-32767]The port to access yourMySQL Cluster(please select a port between 30000-32767 and make sure that this port isn't used before).Cluster Size (Gi)YourMySQL Clustersize inGigaBytes.Object Storage Endpoint:The domain of your object storage without addinghttporhttps(e.g example.com).Object Storage PortThe port that you will use to access your object storage.Object Storage Access KeyThe access key for your object storage, you cand find it onGIG based clouds Portal.Object Storage Secret KeyThe secret key for your object storage, you cand find it onGIG based clouds Portal.Bucket NameEnter your bucket name (If you entered a name ofexisting bucketthe script will use it. However, if you entered a new name that isn't used before the script willcreate a bucketwith the new name for you then use it).Enter Your Backup NumberThe script will show you the list of backups connected to you object storage endpoint you entered before, just enter the number of the desired backup to be used in this cluster.For every finished operation you will receive a couple of confirmation messages. At the end, you'll have yourMySQL Clusterconfigured.Youselect<BackupName>
Creatingserverpool...
ServerPoolStatus200Addkuberneteshoststoserverpool...
<KUBERNETES_HOSTS_LIST>
AddhoststoServerPoolStatus200CreatingLoadBalancer...
<LOAD_BALANCER_ID>
Deployingyourcluster...
NAME:<CLUSTER_NAME>
LASTDEPLOYED:<DEPLOYMENT_DATE_TIME>
NAMESPACE:default
STATUS:deployed
REVISION:1TESTSUITE:None

Pleasewaituntiltheclusterbecomesready...
Accessyourclusterwithport<MYSQL_NODE_PORT>You can test whether yourMySQL Clusteris ready or not using this commandkubectl get pod | grep <CLUSTER_NAME>.Adittionally, to access yourMySQL Clusteruse this commandmysql -uroot -p -h <CLOUDSPACE_PUBLIC_IP> -P <CLUSTER_PORT>.List ClustersYou can select this option if you want tolist all your MySQL Clusterswith theiraccess ports.Edit ClusterYou can select this option if you want toedit MySQL Clusters, the script allows you tochange the number of replicasandchange the backup schedule(Changing backup schedule is allowed only forMySQL Clustersthat hasauto backupenabled).Remove ClusterYou can select this option if you want touninstall a MySQL Cluster. Just enter thecluster namethat you want to remove and it will be uninstalled.List BackupsYou can select this option if you want tolist all your backups.InputValueObject Storage EndpointThe domain of your object storage without addinghttporhttps(e.g example.com).Object Storage PortThe port that you will use to access your object storage.Object Storage Access KeyThe access key for your object storage, you cand find it onGIG based clouds Portal.Object Storage Secret KeyThe secret key for your object storage, you cand find it onGIG based clouds Portal.Bucket NameEnter the bucket name that contains your backups.