All Projects → FairwindsOps → Gemini

FairwindsOps / Gemini

Licence: apache-2.0
Automated backups of PersistentVolumeClaims in Kubernetes using VolumeSnapshots

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Gemini

Xenon
Create backups of your discord server
Stars: ✭ 90 (-9.09%)
Mutual labels:  backup, backups
VestaCP-Sync-Backups-To-Mega
VestaCP: uploading backups to the MEGA cloud
Stars: ✭ 17 (-82.83%)
Mutual labels:  backups, backup
Holland
Holland Backup Manager
Stars: ✭ 132 (+33.33%)
Mutual labels:  backup, backups
Rdiffweb
A simplified backup management software for quick access to your archives through an efficient web interface.
Stars: ✭ 76 (-23.23%)
Mutual labels:  backup, backups
Content Lambda Boto3
Automating AWS with Lambda, Python, and Boto3
Stars: ✭ 91 (-8.08%)
Mutual labels:  backup, backups
snapbtrex
snapbtrex is a small utility that keeps snapshots of btrfs filesystems and optionally send them to a remote system or syncs them locally.
Stars: ✭ 29 (-70.71%)
Mutual labels:  backups, backup
Backup And Recovery Howtos
Guides to setting up a media storage system, backing it up, and recovering from failures
Stars: ✭ 235 (+137.37%)
Mutual labels:  backup, backups
Bareos
Main repository with the code for the libraries and daemons
Stars: ✭ 651 (+557.58%)
Mutual labels:  backup, backups
bash-backup
Simple backup script for GNU/Linux servers
Stars: ✭ 76 (-23.23%)
Mutual labels:  backups, backup
terraform-aws-backup
Terraform module to provision AWS Backup, a fully managed backup service that makes it easy to centralize and automate the back up of data across AWS services such as EBS volumes, RDS databases, DynamoDB tables, EFS file systems, and AWS Storage Gateway volumes.
Stars: ✭ 62 (-37.37%)
Mutual labels:  backups, backup
Wal E
Continuous Archiving for Postgres
Stars: ✭ 3,313 (+3246.46%)
Mutual labels:  backup, backups
Drivebackupv2
Uploads Minecraft backups to Google Drive/OneDrive or by (S)FTP
Stars: ✭ 26 (-73.74%)
Mutual labels:  backup, backups
Docker Openldap Backup
A docker image to run OpenLDAP, and make periodic backups 🐳
Stars: ✭ 75 (-24.24%)
Mutual labels:  backup
Laravel Backup
A easy-to-use backup manager for Laravel
Stars: ✭ 93 (-6.06%)
Mutual labels:  backup
Fwbackups
A feature-rich, user-friendly backup program [bugfixes only]
Stars: ✭ 74 (-25.25%)
Mutual labels:  backups
Docker Crashplan
CrashPlan docker container
Stars: ✭ 88 (-11.11%)
Mutual labels:  backup
Archivebox
🗃 Open source self-hosted web archiving. Takes URLs/browser history/bookmarks/Pocket/Pinboard/etc., saves HTML, JS, PDFs, media, and more...
Stars: ✭ 12,383 (+12408.08%)
Mutual labels:  backups
Cv4pve Barc
Backup And Restore Ceph for Proxmox VE
Stars: ✭ 74 (-25.25%)
Mutual labels:  backup
Useful Tools
A list of useful tools and programs for developers, DevOps and SysAdmins
Stars: ✭ 74 (-25.25%)
Mutual labels:  backups
Bups
Simple GUI for Bup, a very efficient backup system.
Stars: ✭ 94 (-5.05%)
Mutual labels:  backup
Gemini Logo

Version CircleCI Go Report Card Codecov

Gemini is a Kubernetes CRD and operator for managing VolumeSnapshots. This allows you to back up your PersistentVolumes on a regular schedule, retire old backups, and restore backups with minimal downtime.

Want to learn more? Reach out on the Slack channel (request invite), send an email to [email protected], or join us for office hours on Zoom

Note: Like the VolumeSnapshot API it builds on, Gemini is currently in beta.

Installation

The Gemini Helm chart will install both the CRD and the operator into your cluster

kubectl create ns gemini
helm repo add fairwinds-stable https://charts.fairwinds.com/stable
helm install gemini fairwinds-stable/gemini --namespace gemini

Prerequisites

You'll need to have the VolumeSnapshot API available in your cluster. This API is in beta as of Kubernetes 1.17, and was introduced as alpha in 1.12.

To check if your cluster has VolumeSnapshots available, you can run

kubectl api-resources | grep volumesnapshots
  • To enable on v1.12-16, set the flag --feature-gates=VolumeSnapshotDataSource=true on the API server binary source
  • To enable VolumeSnapshots on kops, see our instructions here
  • Depending on your environment, you may need to configure the VolumeSnapshot API as well as the CSI. Fortunately, some managed Kubernetes providers like DigitalOcean support VolumeSnapshots by default, even on older versions

Before getting started with Gemini, it's a good idea to make sure you're able to create a VolumeSnapshot manually.

Usage

Backup

Gemini can schedule backups for an existing PVC, or create a new PVC to back up.

Schedules

The schedule parameter tells Gemini how often to run backups, and how many historical backups to keep.

For example, the following schedule tells Gemini to create new backups every 10 minutes, always keep the last 3 backups, and keep historical hourly, daily, monthly, and yearly backups.

apiVersion: gemini.fairwinds.com/v1beta1
kind: SnapshotGroup
metadata:
  name: test-volume
spec:
  persistentVolumeClaim:
    claimName: postgres
  schedule:
    - every: 10 minutes
      keep: 3
    - every: hour
      keep: 1
    - every: day
      keep: 1
    - every: month
      keep: 1
    - every: year
      keep: 1

Note that keep specifies how many historical backups you want, in addition to the most recent backup. This way the schedule

- every: 10 minutes
  keep: 3

will always give you at least 30 minutes of backup coverage. But you will see four snapshots at any given time. E.g. right after a new snapshot is created, you'll see backups for

  • 0m ago
  • 10m ago
  • 20m ago
  • 30m ago

Using an Existing PVC

See the extended example

The following example schedules backups every 10 minutes for a pre-existing PVC named postgres.

apiVersion: gemini.fairwinds.com/v1beta1
kind: SnapshotGroup
metadata:
  name: test-volume
spec:
  persistentVolumeClaim:
    claimName: postgres
  schedule:
    - every: 10 minutes
      keep: 3

Creating a New PVC

You can also specify an entire PVC spec inside the SnapshotGroup if you'd like Gemini to create the PVC for you.

apiVersion: gemini.fairwinds.com/v1beta1
kind: SnapshotGroup
metadata:
  name: test-volume
spec:
  persistentVolumeClaim:
    spec:
      accessModes:
        - ReadWriteOnce
      resources:
        requests:
          storage: 1Gi
  schedule:
    - every: 10 minutes
      keep: 3

The PVC will have the same name as the SnapshotGroup, (in this example, test-volume)

Snapshot Spec

You can use the spec.template field to set the template for any VolumeSnapshots that get created, most notably the name of the snapshot class you want to use.

apiVersion: gemini.fairwinds.com/v1beta1
kind: SnapshotGroup
metadata:
  name: test-volume
spec:
  persistentVolumeClaim:
    claimName: postgres
  schedule:
    - every: "10 minutes"
      keep: 3
  template:
    spec:
      volumeSnapshotClassName: test-snapshot-class      

Restore

Caution: you cannot alter a PVC without some downtime!

You can restore your PVC to a particular point in time using an annotation.

First, check out what VolumeSnapshots are available:

$ kubectl get volumesnapshot
NAME                           AGE
test-volume-1585945609         15s

Next, you'll need to remove any Pods that are using the PVC:

$ kubectl scale all --all --replicas=0

The copy the timestamp from the first step, and use that to annotate the SnapshotGroup:

$ kubectl annotate snapshotgroup/test-volume --overwrite \
  "gemini.fairwinds.com/restore=1585945609"

Finally, you can scale your Pods back up:

$ kubectl scale all --all --replicas=1

End-to-End Example

To see gemini working end-to-end, check out the HackMD example

Caveats

  • Like the VolumeSnapshot API it builds on, Gemini is currently in beta
  • Be sure to test out both the backup and restore process to ensure Gemini is working properly
  • VolumeSnapshots simply grab the current state of the volume, without respect for things like in-flight database transactions. You may find you need to stop the application in order to get a consistently usable VolumeSnapshot.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].