Code Monkey home page Code Monkey logo

backstore's Introduction

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.

Step 1: Install Project related Dependencies

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

backstore's People

Contributors

r4rajat avatar

Stargazers

Xiangbo Ma avatar Ivan Sim avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.