|
4 | 4 | [](LICENSE) |
5 | 5 | [](https://edenlab.io) |
6 | 6 |
|
7 | | -The EBS snapshot provision operator automatically provisions Amazon EBS snapshots to be used in an existing K8S cluster. |
| 7 | +The **EBS Snapshot Provision Operator** automates the provisioning of Amazon EBS snapshots into an existing Kubernetes |
| 8 | +cluster. This allows seamless restoration of volumes from snapshots that were originally created in other clusters. |
| 9 | + |
| 10 | +The operator is a small tool that carefully brings snapshots from **the past** and makes them part of **a new future**. |
8 | 11 |
|
9 | 12 | ## Description |
10 | 13 |
|
11 | | -For dynamic creation and provisioning of AWC EBS snapshots for a K8S cluster, the following components can be |
12 | | -used: [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver/tree/master/examples/kubernetes/snapshot). |
13 | | -and [external snapshotter](https://github.com/kubernetes-csi/external-snapshotter) |
14 | | -This approach is good when we want to create the snapshots manually from an existing PVC within the same cluster. |
15 | | -However, if we want to automatically provision AWS EBS snapshots and then use in, for example, in a new K8S cluster for |
16 | | -further |
17 | | -restoration, |
18 | | -then the `aws-ebs-csi-driver` and `external-snapshotter` do not support such an automated process for a number of |
19 | | -reasons. |
20 | | -The EBS snapshot provision operator makes this possible via the CR: |
| 14 | +For dynamic creation and provisioning of AWS EBS snapshots within the **same** Kubernetes cluster, the standard approach |
| 15 | +relies on the following components: |
| 16 | + |
| 17 | +- [aws-ebs-csi-driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver) |
| 18 | +- [external-snapshotter](https://github.com/kubernetes-csi/external-snapshotter) |
| 19 | + |
| 20 | +This standard approach works well when snapshots are created manually from a PersistentVolumeClaim (PVC) within the same |
| 21 | +cluster. |
| 22 | + |
| 23 | +### What problem does this operator solve? |
| 24 | + |
| 25 | +When you need to **automatically provision AWS EBS snapshots created in one cluster into a different cluster** |
| 26 | +(e.g., for backup restoration into a new environment), the `aws-ebs-csi-driver` and `external-snapshotter` do not |
| 27 | +support this process directly. |
| 28 | + |
| 29 | +The **EBS Snapshot Provision Operator** addresses this gap by watching for AWS EBS snapshots matching specific tags and |
| 30 | +automatically creating the corresponding `VolumeSnapshot` and `VolumeSnapshotContent` Kubernetes resources in the target |
| 31 | +cluster. |
| 32 | + |
| 33 | +## Key features |
| 34 | + |
| 35 | +- Automatically detects and provisions EBS snapshots created in other clusters. |
| 36 | +- Supports custom tagging for identifying snapshots. |
| 37 | +- Periodically polls the AWS API to discover new snapshots. |
| 38 | +- Automatically creates the required Kubernetes resources (`VolumeSnapshot` and `VolumeSnapshotContent`). |
| 39 | + |
| 40 | +## Custom Resource Specification |
| 41 | + |
| 42 | +The operator is configured via a Custom Resource (CR), which defines the snapshot import policy: |
21 | 43 |
|
22 | 44 | ```yaml |
23 | 45 | spec: |
24 | | - # required fields |
25 | | - clusterName: deps-develop # tenant name |
26 | | - region: us-east-1 # AWS region |
27 | | - frequency: 1m # AWS API request frequency to poll the list of snapshots |
28 | | - volumeSnapshotClassName: ebs-csi-snapshot-class # current CSI snapshot class name |
| 46 | + # Required fields |
| 47 | + clusterName: deps-develop # Tenant/Cluster name from which snapshots originate |
| 48 | + region: us-east-1 # AWS region where snapshots are stored |
| 49 | + frequency: 1m # Polling frequency for AWS API (e.g., 1 minute) |
| 50 | + volumeSnapshotClassName: ebs-csi-snapshot-class # Name of the VolumeSnapshotClass to use |
29 | 51 | ``` |
30 | 52 |
|
31 | 53 | ## Requirements |
32 | 54 |
|
33 | | -* The `VolumeSnapshotClass` parameters are: |
34 | | - ```yaml |
35 | | - snapshotClasses: |
| 55 | +### VolumeSnapshotClass configuration |
| 56 | +
|
| 57 | +The target cluster must define a `VolumeSnapshotClass` with parameters that enable tagging of snapshots. |
| 58 | +The following example shows the required placeholders that allow the operator to map AWS snapshot tags to the |
| 59 | +corresponding `VolumeSnapshot` and `VolumeSnapshotContent` resources: |
| 60 | + |
| 61 | +```yaml |
| 62 | +snapshotClasses: |
36 | 63 | - name: ebs-csi-snapshot-class |
37 | | - # . . . |
38 | 64 | parameters: |
39 | 65 | tagSpecification_1: "{{`snapshotNamespace={{ .VolumeSnapshotNamespace }}`}}" |
40 | 66 | tagSpecification_2: "{{`snapshotName={{ .VolumeSnapshotName }}`}}" |
41 | 67 | tagSpecification_3: "{{`snapshotContentName={{ .VolumeSnapshotContentName }}`}}" |
42 | | - ``` |
43 | | - should contain additional parameters with placeholders for AWS snapshot tags. |
| 68 | +``` |
| 69 | +
|
| 70 | +This tagging scheme allows the operator to correctly match AWS snapshots to Kubernetes objects in the target cluster. |
44 | 71 |
|
45 | 72 | ## Getting Started |
46 | 73 |
|
|
0 commit comments