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

backup: add example for backup restore migrate #396

Closed
wants to merge 1 commit into from
Closed
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
8 changes: 8 additions & 0 deletions examples/backup/backup-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Backup
metadata:
name: minimal
namespace: default
spec:
destination:
fleet: "quickstart"
18 changes: 18 additions & 0 deletions examples/backup/backup-schedule.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Backup
metadata:
name: schedule-matchlabels
namespace: default
spec:
schedule: "0 0 * * *" # Runs at midnight every day.
destination:
fleet: quickstart
clusters:
- kind: AttachedCluster
name: kurator-member2
policy:
resourceFilter:
labelSelector:
matchLabels:
env: test
ttl: 240h # 10 * 24 hours
13 changes: 13 additions & 0 deletions examples/backup/backup-specific-ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Backup
metadata:
name: specific-ns
namespace: default
spec:
destination:
fleet: quickstart
policy:
resourceFilter:
includedNamespaces:
- kurator-backup
ttl: 720h # 30 * 24 hours
19 changes: 19 additions & 0 deletions examples/backup/common/attachedcluster.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
apiVersion: cluster.kurator.dev/v1alpha1
kind: AttachedCluster
metadata:
name: kurator-member1
namespace: default
spec:
kubeconfig:
name: kurator-member1
key: kurator-member1.config
---
apiVersion: cluster.kurator.dev/v1alpha1
kind: AttachedCluster
metadata:
name: kurator-member2
namespace: default
spec:
kubeconfig:
name: kurator-member2
key: kurator-member2.config
45 changes: 45 additions & 0 deletions examples/backup/common/busybox.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
apiVersion: v1
kind: Namespace
metadata:
name: kurator-backup
---
apiVersion: v1
kind: Pod
metadata:
name: busybox
namespace: kurator-backup
spec:
containers:
- name: test-container
image: busybox
command: ["/bin/sh", "-c", "echo Hello Kurator! && sleep 3600"]
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: test-pvc
namespace: kurator-backup
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
---
apiVersion: v1
kind: Pod
metadata:
name: busybox-with-pv
namespace: kurator-backup
spec:
containers:
- name: test-container
image: busybox
command: ["/bin/sh", "-c", "echo Hello Kurator!! > /test-pvc/hello.txt && sleep 3600"]
volumeMounts:
- name: test-volume
mountPath: /test-pvc
volumes:
- name: test-volume
persistentVolumeClaim:
claimName: test-pvc
11 changes: 11 additions & 0 deletions examples/backup/common/fleet.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: fleet.kurator.dev/v1alpha1
kind: Fleet
metadata:
name: quickstart
namespace: default
spec:
clusters:
- name: kurator-member1
kind: AttachedCluster
- name: kurator-member2
kind: AttachedCluster
20 changes: 20 additions & 0 deletions examples/backup/migrate-specific-ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Migrate
metadata:
name: specific-ns
namespace: default
spec:
sourceCluster:
fleet: quickstart
clusters:
- kind: AttachedCluster
name: kurator-member1
targetCluster:
fleet: quickstart
clusters:
- kind: AttachedCluster
name: kurator-member2
policy:
resourceFilter:
includedNamespaces:
- kurator-backup
7 changes: 7 additions & 0 deletions examples/backup/restore-minimal.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Restore
metadata:
name: minimal
namespace: default
spec:
backupName: specific-ns
16 changes: 16 additions & 0 deletions examples/backup/restore-specific-ns.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: backup.kurator.dev/v1alpha1
kind: Restore
metadata:
name: specific-ns
namespace: default
spec:
backupName: minimal
destination:
fleet: quickstart
clusters:
- kind: AttachedCluster
name: kurator-member1
policy:
resourceFilter:
includedNamespaces:
- kurator-backup
Loading