Skip to content

Commit abc6bc0

Browse files
committed
Create aks2oke-mysql-policy.sh
1 parent f6f848b commit abc6bc0

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

aks2oke-mysql-policy.sh

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# export MY_REGION=us-east-2
2+
export OCI_MY_OBJECT_STORAGE_PROFILE=oci-migration
3+
4+
echo '------Create backup policies'
5+
cat <<EOF | kubectl apply -f -
6+
apiVersion: config.kio.kasten.io/v1alpha1
7+
kind: Policy
8+
metadata:
9+
name: aks2oke-mysql-backup
10+
namespace: kasten-io
11+
spec:
12+
comment: ""
13+
frequency: "@hourly"
14+
actions:
15+
- action: backup
16+
backupParameters:
17+
profile:
18+
namespace: kasten-io
19+
name: $OCI_MY_OBJECT_STORAGE_PROFILE
20+
- action: export
21+
exportParameters:
22+
frequency: "@hourly"
23+
migrationToken:
24+
name: ""
25+
namespace: ""
26+
profile:
27+
name: $OCI_MY_OBJECT_STORAGE_PROFILE
28+
namespace: kasten-io
29+
receiveString: ""
30+
exportData:
31+
enabled: true
32+
retention:
33+
hourly: 0
34+
daily: 0
35+
weekly: 0
36+
monthly: 0
37+
yearly: 0
38+
retention:
39+
hourly: 4
40+
daily: 1
41+
weekly: 1
42+
monthly: 0
43+
yearly: 0
44+
selector:
45+
matchExpressions:
46+
- key: k10.kasten.io/appNamespace
47+
operator: In
48+
values:
49+
- yong-mysql
50+
EOF
51+
52+
sleep 3
53+
54+
echo '-------Kickoff the on-demand backup job'
55+
sleep 2
56+
57+
cat <<EOF | kubectl create -f -
58+
apiVersion: actions.kio.kasten.io/v1alpha1
59+
kind: RunAction
60+
metadata:
61+
generateName: run-backup-
62+
spec:
63+
subject:
64+
kind: Policy
65+
name: aks2oke-mysql-backup
66+
namespace: kasten-io
67+
EOF

0 commit comments

Comments
 (0)