Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/miracle2k/k8s-snapshots

Automatic Volume Snapshots on Kubernetes.
https://github.com/miracle2k/k8s-snapshots

Last synced: about 1 month ago
JSON representation

Automatic Volume Snapshots on Kubernetes.

Awesome Lists containing this project

README

        

Interval-based Volume Snapshots and Expiry on Kubernetes
========================================================

**What you do:** Create a custom `SnapshotRule` resource which defines your desired snapshot intervals.
**What I do:** Create snapshots of your volumes, and expire old ones using a Grandfather-father-son backup scheme.

**Supported Environments**:

- Google Compute Engine disks.
- AWS EBS disks.
- Digital Ocean.

Want to help adding support for other backends? It's pretty straightforward.
Have a look at the [API that backends need to implement](https://github.com/miracle2k/k8s-snapshots/blob/master/k8s_snapshots/backends/abstract.py).

Quickstart
----------

A persistent volume claim:

```
cat <
spec:
serviceAccountName: k8s-snapshots
containers:
- name: k8s-snapshots
image: elsdoerfer/k8s-snapshots:v2.0

```

Further Configuration Options
-----------------------------

### Pinging a third party service


PING_URL

We'll send a GET request to this url whenever a backup completes.
This is useful for integrating with monitoring services like
Cronitor or Dead Man's Snitch.

### Make snapshot names more readable

If your persistent volumes are auto-provisioned by Kubernetes, then
you'll end up with snapshot names such as
``pv-pvc-01f74065-8fe9-11e6-abdd-42010af00148``. If you want that
prettier, set the enviroment variable ``USE_CLAIM_NAME=true``. Instead
of the auto-generated name of the persistent volume, *k8s-snapshots*
will instead use the name that you give to your
``PersistentVolumeClaim``.

### SnapshotRule resources

It's possible to ask *k8s-snapshots* to create snapshots of volumes
for which no `PersistentVolume` object exists within the Kubernetes
cluster. For example, you might have a volume at your Cloud provider
that you use within Kubernetes by referencing it directly.

To do this, we use a custom Kubernetes resource, `SnapshotRule`.

First, you need to create this custom resource.

On Kubernetes 1.7 and higher:

```
cat <

LOG_LEVEL
**Default: INFO**. Possible values: DEBUG, INFO, WARNING, ERROR


JSON_LOG
**Default: False**. Output the log messages as JSON objects for
easier processing.


TZ
**Default: UTC**. Used to change the timezone. ie. TZ=America/Montreal

FAQ
----

**What if I manually create snapshots for the same volumes that
*k8s-snapshots* manages?**

Starting with v0.3, when *k8s-snapshots* decides when to create the
next snapshot, and which snapshots it deletes, it no longer considers
snapshots that are not correctly labeled by it.