Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/miracle2k/k8s-snapshots
- Owner: miracle2k
- License: bsd-2-clause
- Created: 2017-01-06T16:07:52.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2023-09-07T14:19:48.000Z (over 1 year ago)
- Last Synced: 2024-08-01T13:29:49.320Z (4 months ago)
- Language: Python
- Homepage:
- Size: 268 KB
- Stars: 350
- Watchers: 8
- Forks: 66
- Open Issues: 24
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGES
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - miracle2k/k8s-snapshots - Automatic Volume Snapshots on Kubernetes. (Python)
- awesome-hacking-lists - miracle2k/k8s-snapshots - Automatic Volume Snapshots on Kubernetes. (Python)
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.