Skip to content

Commit 20b6045

Browse files
authored
Merge pull request #8 from edenlabllc/feature/FFS-1-investigate-migration-of-existing-aws-clusters-provisioned-via-tf-to-k8s-capi
Improve README.md describing the real use cases.
2 parents f562c06 + 08f621d commit 20b6045

2 files changed

Lines changed: 50 additions & 23 deletions

File tree

README.md

Lines changed: 49 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -4,43 +4,70 @@
44
[![Software License](https://img.shields.io/github/license/edenlabllc/ebs-snapshot-provision.operators.infra.svg?style=for-the-badge)](LICENSE)
55
[![Powered By: Edenlab](https://img.shields.io/badge/powered%20by-edenlab-8A2BE2.svg?style=for-the-badge)](https://edenlab.io)
66

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**.
811

912
## Description
1013

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:
2143

2244
```yaml
2345
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
2951
```
3052
3153
## Requirements
3254
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:
3663
- name: ebs-csi-snapshot-class
37-
# . . .
3864
parameters:
3965
tagSpecification_1: "{{`snapshotNamespace={{ .VolumeSnapshotNamespace }}`}}"
4066
tagSpecification_2: "{{`snapshotName={{ .VolumeSnapshotName }}`}}"
4167
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.
4471
4572
## Getting Started
4673

internal/aws/snapshot.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ func (r *DefaultSnapshotRetriever) GetSnapshots(clusterName, region string) ([]*
3939
svc := ec2.New(s)
4040
input := &ec2.DescribeSnapshotsInput{
4141
Filters: []*ec2.Filter{
42-
&ec2.Filter{
42+
{
4343
Name: aws.String("tag:kubernetes.io/cluster/" + clusterName),
4444
Values: []*string{aws.String("owned")},
4545
},

0 commit comments

Comments
 (0)