Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(fleet/rancher-backup) add rancher-backup operator on DEV #807

Merged
merged 1 commit into from
Mar 31, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions fleet/lib/rancher-backup-crd/fleet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
defaultNamespace: cattle-resources-system
labels:
bundle: &name rancher-backup-crd
helm:
chart: *name
releaseName: *name
repo: https://charts.rancher.io
version: 104.0.2+up5.0.2
takeOwnership: true
timeoutSeconds: 60
waitForJobs: true
49 changes: 49 additions & 0 deletions fleet/lib/rancher-backup/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Rancher Backup Operator Fleet Bundle

## Requirements

For this bundle to work properly, complete the following steps:

### 1. Create an IAM User in AWS

- Create an IAM user in AWS named `rancher-backup-(site)`.
- Generate an **AccessKey**, but **do not allow console access**.

### 2. Store User Credentials

- Save the generated credentials in **1Password**.
- Store them in the `k8s.(site)` vault, named **"rancher-backup"**.

### 3. Create an AWS S3 Bucket

- Create an **S3 Bucket** with the default configuration.
- Name it `rancher-backup-(site)`.

### 4. Configure the Bucket Policy

- Insert the following policy inside the bucket, replacing `(site)` with the correct name:

```json
{
"Version": "2012-10-17",
"Id": "myPol",
"Statement": [
{
"Sid": "Stmt130",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::133428025519:user/rancher-backup-(site)"
},
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::rancher-bkp-(site)",
"arn:aws:s3:::rancher-bkp-(site)/*"
]
}
]
}
```

## Deployment

After completing all the above steps, the bundle will be ready for deployment. 🚀
8 changes: 8 additions & 0 deletions fleet/lib/rancher-backup/base/backup-s3-recurring.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: resources.cattle.io/v1
kind: Backup
metadata:
name: s3-recurring
spec:
resourceSetName: rancher-resource-set
schedule: "@every 24h"
retentionCount: 30
19 changes: 19 additions & 0 deletions fleet/lib/rancher-backup/base/externalsecret-rancher-bkp.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
name: rancher-bkp
namespace: cattle-resources-system
spec:
secretStoreRef:
kind: ClusterSecretStore
name: onepassword
data:
- secretKey: accessKey
remoteRef:
key: rancher-backup
property: username
- secretKey: secretKey
remoteRef:
key: rancher-backup
property: password
4 changes: 4 additions & 0 deletions fleet/lib/rancher-backup/base/kustomization.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
resources:
- externalsecret-rancher-bkp.yaml
- backup-s3-recurring.yaml
20 changes: 20 additions & 0 deletions fleet/lib/rancher-backup/fleet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
defaultNamespace: cattle-resources-system
labels:
bundle: &name rancher-backup
helm:
chart: *name
releaseName: *name
repo: https://charts.rancher.io
version: 104.0.2+up5.0.2
takeOwnership: true
timeoutSeconds: 60
waitForJobs: true
valuesFiles:
- values.yaml
dependsOn:
- selector:
matchLabels:
bundle: rancher-backup-crd
kustomize:
dir: base
13 changes: 13 additions & 0 deletions fleet/lib/rancher-backup/values.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
## Default s3 bucket for storing all backup files created by the backup-restore-operator
s3:
enabled: true
credentialSecretName: rancher-bkp
credentialSecretNamespace: cattle-resources-system
region: us-east-1
bucketName: rancher-bkp-${ .ClusterLabels.site }
folder: ${ .ClusterLabels.site }
endpoint: s3.us-east-1.amazonaws.com

# Add log level flags to backup-restore
debug: true
trace: false
1 change: 1 addition & 0 deletions fleet/s/cp/c/rancher/rancher-backup
1 change: 1 addition & 0 deletions fleet/s/cp/c/rancher/rancher-backup-crd
1 change: 1 addition & 0 deletions fleet/s/dev/c/rancher/rancher-backup
1 change: 1 addition & 0 deletions fleet/s/dev/c/rancher/rancher-backup-crd
1 change: 1 addition & 0 deletions fleet/s/ls/c/rancher/rancher-backup
1 change: 1 addition & 0 deletions fleet/s/ls/c/rancher/rancher-backup-crd
1 change: 1 addition & 0 deletions fleet/s/tu/c/rancher/rancher-backup
1 change: 1 addition & 0 deletions fleet/s/tu/c/rancher/rancher-backup-crd
Loading