Coder Social home page Coder Social logo

advanced-operator's Introduction

Sample mongoDB operator using Ansible

This operator is an example of how to add backup/restore features to an ansible operator. The ondemandbackup and restore roles can be used directly in an existing Ansible operator to create backup and restore CRs.

How to add the roles to an existing project:

  1. put each role in the roles directory of the existing project

  2. add a new api to the project for each role. Make sure you change the group to the one your operator is already using. The kind can be set to anything.

    $ operator-sdk create api --group=database --kind=OnDemandBackup --version=v1alpha1

  3. Edit the main.yaml in the tasks directory to make sure the backup and restore logic makes sense for your application.

If you change/add variables to add more user customization to the backup/restore, make sure you add them to the defaults/main.yaml, and make sure they can all be set by default in the related CRs.

There is also a scheduled backup added to the mongoDB role - it takes the form of a cronjob task that you can find at the end of the mongodb/tasks/main.yaml file. This task (and the backup pvc creation before it) enables a user to create a cronjob to take automatic backups.

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.