backstore

command module
v0.0.0-...-da41967 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 7, 2022 License: BSD-3-Clause Imports: 11 Imported by: 0

README ΒΆ

BackStore - Backup and Restore PVC Custom k8s Controller


πŸ“ Table of Contents

🧐 About

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.

🏁 Getting Started

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.

Prerequisites

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

Installing

A step by step series of examples that tell you how to get a development env running.

go mod tidy
Step 2: Running a 2 Node Mock Kubernetes Server Locally using minikube
minikube start --nodes 2
Step 3: Enable volumesnapshots and csi-hostpath-driver addons:
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
Step 4: Setting Up Environmental Variables

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
Step 5: Creating MySQL Deployments, PV and PVC
kubectl create -f manifests/mysql-secret.yaml
kubectl create -f manifests/mysql-storage.yaml
kubectl create -f manifests/mysql-deployment.yaml
Step 5: Creating CRDs for Backup and Restore
kubectl create -f manifests/backup-crd.yaml
kubectl create -f manifests/restore-crd.yaml

πŸ”§ Running the Code

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

✍️ Authors

πŸŽ‰ Acknowledgements

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL