-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathpostgresql-policy.sh
executable file
·59 lines (56 loc) · 1.2 KB
/
postgresql-policy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
echo '------Create backup policies'
cat <<EOF | kubectl apply -f -
apiVersion: config.kio.kasten.io/v1alpha1
kind: Policy
metadata:
name: yong-postgresql-backup
namespace: kasten-io
spec:
comment: ""
frequency: "@hourly"
actions:
- action: backup
backupParameters:
profile:
namespace: kasten-io
name: $MY_OBJECT_STORAGE_PROFILE
- action: export
exportParameters:
frequency: "@hourly"
profile:
name: $MY_OBJECT_STORAGE_PROFILE
namespace: kasten-io
exportData:
enabled: true
retention:
hourly: 0
daily: 0
weekly: 0
monthly: 0
yearly: 0
retention:
hourly: 4
daily: 1
weekly: 1
monthly: 0
yearly: 0
selector:
matchExpressions:
- key: k10.kasten.io/appNamespace
operator: In
values:
- yong-postgresql
EOF
# sleep 8
# echo '-------Kickoff the on-demand backup job'
# cat <<EOF | kubectl create -f -
# apiVersion: actions.kio.kasten.io/v1alpha1
# kind: RunAction
# metadata:
# generateName: run-backup-
# spec:
# subject:
# kind: Policy
# name: yong-postgresql-backup
# namespace: kasten-io
# EOF