The BackStore custom kubernetes controller is written primarily in go lang. This controller explicitly keeps a watch on newly created CRs for Backupping and Restoring in all Namespaces,
And as soon as a new CR is created, our controller will create Backup or Restore Data of PVC based on the CR.
These instructions will get you the project up and running on your local machine for development and testing purposes. See Running the Code for notes on how to deploy the project on a Local System or on a Kubernetes Server.
To run the BackStore Controller on Local System, first we need to install following Software Dependencies.
Once above Dependencies are installed we can move with further steps
A step by step series of examples that tell you how to get a development env running.
go mod tidy
minikube start --nodes 2
minikube addons enable volumesnapshots
minikube addons enable csi-hostpath-driver
kubectl create -f manifests/rbac-csi-snapshotter.yaml
kubectl create -f manifests/rbac-external-snapshotter.yaml
Set up the Environmental variables according to your needs. The Application will run with defaults as mentioned in the following table
Environmental Variable | Usage | Default Values |
---|---|---|
BACKSTORE_RESTORE_QUEUE | Queue for holding Restore CR objects | BACKSTORE_RESTORE |
BACKSTORE_BACKUP_QUEUE | Queue for holding Backup CR objects | BACKSTORE_BACKUP |
kubectl create -f manifests/mysql-secret.yaml
kubectl create -f manifests/mysql-storage.yaml
kubectl create -f manifests/mysql-deployment.yaml
kubectl create -f manifests/backup-crd.yaml
kubectl create -f manifests/restore-crd.yaml
To Run the BackStore Controller on local machine, Open a terminal in the Project and run following command
go build
./backstore
Insert Some Data in Mysql PV,PVC
kubectl create -f manifests/backup.yaml
Delete Data from Mysql PV,PVC
kubectl create -f manifests/restore.yaml
- @r4rajat - Implementation