Skip to content

Commit 0ca1250

Browse files
committed
(fleet/rancher-backup) add rancher-backup operator on DEV
1 parent 94cf1fa commit 0ca1250

15 files changed

+133
-0
lines changed
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
defaultNamespace: cattle-resources-system
3+
labels:
4+
bundle: &name rancher-backup-crd
5+
helm:
6+
chart: *name
7+
releaseName: *name
8+
repo: https://charts.rancher.io
9+
version: 104.0.2+up5.0.2
10+
takeOwnership: true
11+
timeoutSeconds: 60
12+
waitForJobs: true

fleet/lib/rancher-backup/README.md

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# Rancher Backup Operator Fleet Bundle
2+
3+
## Requirements
4+
5+
For this bundle to work properly, complete the following steps:
6+
7+
### 1. Create an IAM User in AWS
8+
9+
- Create an IAM user in AWS named `rancher-backup-(site)`.
10+
- Generate an **AccessKey**, but **do not allow console access**.
11+
12+
### 2. Store User Credentials
13+
14+
- Save the generated credentials in **1Password**.
15+
- Store them in the `k8s.(site)` vault, named **"rancher-backup"**.
16+
17+
### 3. Create an AWS S3 Bucket
18+
19+
- Create an **S3 Bucket** with the default configuration.
20+
- Name it `rancher-backup-(site)`.
21+
22+
### 4. Configure the Bucket Policy
23+
24+
- Insert the following policy inside the bucket, replacing `(site)` with the correct name:
25+
26+
```json
27+
{
28+
"Version": "2012-10-17",
29+
"Id": "myPol",
30+
"Statement": [
31+
{
32+
"Sid": "Stmt130",
33+
"Effect": "Allow",
34+
"Principal": {
35+
"AWS": "arn:aws:iam::133428025519:user/rancher-backup-(site)"
36+
},
37+
"Action": "s3:*",
38+
"Resource": [
39+
"arn:aws:s3:::rancher-bkp-(site)",
40+
"arn:aws:s3:::rancher-bkp-(site)/*"
41+
]
42+
}
43+
]
44+
}
45+
```
46+
47+
## Deployment
48+
49+
After completing all the above steps, the bundle will be ready for deployment. 🚀
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
apiVersion: resources.cattle.io/v1
2+
kind: Backup
3+
metadata:
4+
name: s3-recurring
5+
spec:
6+
resourceSetName: rancher-resource-set
7+
schedule: "@every 24h"
8+
retentionCount: 30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
apiVersion: external-secrets.io/v1beta1
3+
kind: ExternalSecret
4+
metadata:
5+
name: rancher-bkp
6+
namespace: cattle-resources-system
7+
spec:
8+
secretStoreRef:
9+
kind: ClusterSecretStore
10+
name: onepassword
11+
data:
12+
- secretKey: accessKey
13+
remoteRef:
14+
key: rancher-backup
15+
property: username
16+
- secretKey: secretKey
17+
remoteRef:
18+
key: rancher-backup
19+
property: password
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
resources:
3+
- externalsecret-rancher-bkp.yaml
4+
- backup-s3-recurring.yaml

fleet/lib/rancher-backup/fleet.yaml

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
defaultNamespace: cattle-resources-system
3+
labels:
4+
bundle: &name rancher-backup
5+
helm:
6+
chart: *name
7+
releaseName: *name
8+
repo: https://charts.rancher.io
9+
version: 104.0.2+up5.0.2
10+
takeOwnership: true
11+
timeoutSeconds: 60
12+
waitForJobs: true
13+
valuesFiles:
14+
- values.yaml
15+
dependsOn:
16+
- selector:
17+
matchLabels:
18+
bundle: rancher-backup-crd
19+
kustomize:
20+
dir: base

fleet/lib/rancher-backup/values.yaml

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
## Default s3 bucket for storing all backup files created by the backup-restore-operator
2+
s3:
3+
enabled: true
4+
credentialSecretName: rancher-bkp
5+
credentialSecretNamespace: cattle-resources-system
6+
region: us-east-1
7+
bucketName: rancher-bkp-${ .ClusterLabels.site }
8+
folder: ${ .ClusterLabels.site }
9+
endpoint: s3.us-east-1.amazonaws.com
10+
11+
# Add log level flags to backup-restore
12+
debug: true
13+
trace: false

fleet/s/cp/c/rancher/rancher-backup

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup-crd

fleet/s/dev/c/rancher/rancher-backup

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup-crd

fleet/s/ls/c/rancher/rancher-backup

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup-crd

fleet/s/tu/c/rancher/rancher-backup

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup
+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../../lib/rancher-backup-crd

0 commit comments

Comments
 (0)