-
Notifications
You must be signed in to change notification settings - Fork 1
/
mongo-restore.yaml
102 lines (101 loc) · 2.32 KB
/
mongo-restore.yaml
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongodb
namespace: dev
spec:
serviceName: "mongodb"
selector:
matchLabels:
app: mongodb
replicas: 1
template:
metadata:
labels:
app: mongodb
spec:
tolerations:
- key: "dedicated"
operator: "Equal"
value: "app"
effect: "NoSchedule"
containers:
- image: mongo:3.4
name: mongodb
ports:
- containerPort: 27017
name: tcp
volumeMounts:
- mountPath: /data/db
name: mongodb-pvc
resources: {}
- image: stakater/mongo-backup-restore-s3:0.0.4
name: mongodb-backup-restore
volumeMounts:
- mountPath: /backup
name: mongodb-pvc
env:
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: mongodb
key: aws_access_key_id
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: mongodb
key: aws_secret_access_key
- name: BUCKET
valueFrom:
secretKeyRef:
name: mongodb
key: bucket
- name: BACKUP_FOLDER
value: "mongo/"
- name: MONGODB_HOST
value: "localhost"
- name: MONGODB_PORT
value: "27017"
# - name: MONGODB_USER Default not set
# value: ""
# - name: MONGODB_PASS Default not set
# value: ""
# - name: MONGODB_DB Not specified. so dump all dbs
# value: ""
- name: CRON_TIME
value: "0 */1 * * *"
- name: TZ
value: "US/Eastern"
- name: CRON_TZ
value: "US/Eastern"
- name: INIT_BACKUP
value: "true"
- name: INIT_RESTORE
value: "true"
# - name: DISABLE_CRON
# value: "false"
restartPolicy: Always
volumeClaimTemplates:
- metadata:
name: mongodb-pvc
spec:
accessModes: [ "ReadWriteMany" ]
storageClassName: efs
resources:
requests:
storage: 2Gi
---
apiVersion: v1
kind: Service
metadata:
labels:
app: mongodb
name: mongodb-svc
namespace: dev
spec:
ports:
- name: "mongo-port"
port: 27017
targetPort: 27017
selector:
app: mongodb