-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy paththermostat-mongodb-online-starter.yaml
149 lines (141 loc) · 4.11 KB
/
thermostat-mongodb-online-starter.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
apiVersion: "v1"
kind: "Template"
metadata:
name: "thermostat-mongodb-online-starter"
objects:
###################
## IMAGE STREAMS ##
###################
#### MONGO #####
# mongodb image
- apiVersion: "v1"
kind: "ImageStream"
metadata:
name: "thermostat-mongodb-32-rhel7"
labels:
app-group: "thermostat-online-starter"
spec:
dockerImageRepository: "registry.access.redhat.com/rhscl/mongodb-32-rhel7"
#################
## CONFIG MAPS ##
#################
- apiVersion: "v1"
kind: "ConfigMap"
metadata:
name: "thermostat-mongodb-config"
labels:
app-group: "thermostat-online-starter"
data:
mongod.conf: |+
##
## For list of options visit:
## https://docs.mongodb.org/manual/reference/configuration-options/
##
# systemLog Options - How to do logging
systemLog:
# Runs the mongod in a quiet mode that attempts to limit the amount of output
quiet: true
# net Options - Network interfaces settings
net:
# Specify port number (27017 by default)
port: 27017
# storage Options - How and Where to store data
storage:
# Directory for datafiles (defaults to /data/db/)
dbPath: /var/lib/mongodb/data
# Limit WiredTiger cache size to avoid consuming too much memory
wiredTiger:
engineConfig:
configString : cache_size=96M
# replication Options - Configures replication
replication:
# Specifies a maximum size in megabytes for the replication operation log (i.e. the oplog,
# 5% of disk space by default)
oplogSizeMB: 64
########################
## DEPLOYMENT CONFIGS ##
########################
# mongodb dc
- apiVersion: "v1"
kind: "DeploymentConfig"
metadata:
name: "thermostat-mongodb-dc"
labels:
app: "thermostat-mongodb-app"
app-group: "thermostat-online-starter"
annotations:
template.alpha.openshift.io/wait-for-ready: "true"
spec:
triggers:
- type: "ConfigChange"
- type: "ImageChange"
imageChangeParams:
automatic: true
containerNames:
- thermostat-mongodb-container
from:
kind: "ImageStreamTag"
name: "thermostat-mongodb-32-rhel7:latest"
template:
metadata:
labels:
app: "thermostat-mongodb-app"
app-group: "thermostat-online-starter"
spec:
containers:
- name: "thermostat-mongodb-container"
image: "thermostat-mongodb-32-rhel7:latest"
imagePullPolicy: "Always"
env:
- name: "MONGODB_ADMIN_PASSWORD"
value: "arst"
- name: "MONGODB_DATABASE"
value: "thermostat"
- name: "MONGODB_PASSWORD"
value: "mongo"
- name: "MONGODB_USER"
value: "mongo"
# OSO Starter: Set container memory limit to 1/4 of our total quota
resources:
limits:
memory: "256Mi"
volumeMounts:
- mountPath: "/var/lib/mongodb/data"
name: "thermostat-mongo-storage"
# OSO Starter: Override mongod.conf to support cache sizes under 1GiB
- mountPath: "/etc/mongod.conf"
name: "mongodb-config-volume"
# Workaround SELinux labelling bug for single file mounts, as suggested in
# https://bugzilla.redhat.com/show_bug.cgi?id=1481617#c1
subPath: "..data/mongod.conf"
volumes:
- name: "thermostat-mongo-storage"
emptyDir: {}
- name: "mongodb-config-volume"
configMap:
name: "thermostat-mongodb-config"
defaultMode: 0660
selector:
app: "thermostat-mongodb-app"
replicas: 1
strategy:
type: "Recreate"
##############
## SERVICES ##
##############
# mongo service
- apiVersion: "v1"
kind: "Service"
metadata:
name: "thermostat-mongodb-svc"
labels:
app: "thermostat-mongodb-app"
app-group: "thermostat-online-starter"
spec:
selector:
app: "thermostat-mongodb-app"
ports:
- name: 27017-tcp
protocol: TCP
port: 27017
targetPort: 27017