-
Notifications
You must be signed in to change notification settings - Fork 0
/
restheart-deployment.yaml
70 lines (70 loc) · 2.05 KB
/
restheart-deployment.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
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: restheart
name: restheart
spec:
replicas: 1
selector:
matchLabels:
app: restheart
strategy:
type: Recreate
template:
metadata:
labels:
app: restheart
spec:
containers:
- name: restheart
args:
- --envFile
- /opt/restheart/etc/restheart.properties
env:
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: restheart-mongodb-secret
key: password
- name: MONGO_USERNAME
valueFrom:
secretKeyRef:
name: restheart-mongodb-secret
key: username
- name: MONGO_URI
value: mongodb://$(MONGO_USERNAME):$(MONGO_PASSWORD)@restheart-mongo:27017
image: softinstigate/restheart:latest
volumeMounts:
- name: conf
mountPath: /opt/restheart/etc/restheart.properties
subPath: restheart.properties
ports:
- containerPort: 8080
initContainers:
- name: mongodb-initiate
command:
- bash
- -c
- for i in {1..100}; do mongo --host restheart-mongo --port 27017 --username $MONGO_USERNAME --password $MONGO_PASSWORD --eval 'if (!rs.status().ok) rs.initiate();' && break || sleep 2; done
image: mongo:4.2
env:
- name: MONGO_PASSWORD
valueFrom:
secretKeyRef:
name: restheart-mongodb-secret
key: password
- name: MONGO_USERNAME
valueFrom:
secretKeyRef:
name: restheart-mongodb-secret
key: username
restartPolicy: Always
volumes:
- name: conf
configMap:
name: restheart-cm
items:
- key: restheart.properties
path: restheart.properties
status: {}