GithubHelp home page GithubHelp logo

safer-rancher's Introduction

Safer Rancher

Backup script for rancher written in GO. Currently, Safer Rancher will backup the Rancher's MySQL database and all the PostgreSQL instances managed by Rancher. The host hosting the Rancher server must be added to the Rancher's hosts. There are 3 ways of using this script: from our rancher catalog, with docker, or using the binary program.

Usage with our catalog (prefered)

The easiest way of using Safer Rancher is to install it from our catalog. You can find the install instructions on the catalog's repository.

Usage with Docker

The Docker image is built automatically by Docker Hub. You can use it like this:

run -e BACKUP_ROOT="/root/backup" -e RANCHER_URL="https://xxx/v2-beta" -e RANCHER_ACCESS_KEY="XXX" -e RANCHER_SECRET_KEY="XxXxXx" -v /var/run/docker.sock:/var/run/docker.sock -v /root/backup:/root/backup safer-rancher

Usage with the Go binary

Compilation

  • Clone the repository in $GOROOT/src/github.com/weyield/
  • go to the rancher-safer directory
  • run go get .
  • run go build -o safer-rancher .

Start

The safer-rancher command need to access the rancher network. Therefore, it must be started on a host controlled by the Rancher instance you want to backup. You must define the following environment variables:

  • BACKUP_ROOT: Full path of the directory where the backups are saved
  • RANCHER_URL: Url of the Rancher API, such as https://xxx/v2-beta
  • RANCHER_ACCESS_KEY: Access key of the Rancher API
  • RANCHER_SECRET_KEY: Secret key of the Rancher API For example, you can run:
BACKUP_ROOT="/root/backup" RANCHER_URL="https://xxx/v2-beta" RANCHER_ACCESS_KEY="XXX" RANCHER_SECRET_KEY="XxXxXx" ./safer-rancher

The following optional environment variables can be used too:

  • ACTIVATE_RANCHER_DATABASE: Skip the backup of the Rancher's MySQL database when false (default is true)
  • ACTIVATE_POSTGRES_DATABASE: Skip the backup of PostgreSQL databases when false (default is true)

Copyright (c) 2017 WeYield

safer-rancher's People

Contributors

picnic avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

picnic

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.