forked from vmwarecloudadvocacy/acme_fitness_demo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
users-db-total.yaml
68 lines (68 loc) · 1.58 KB
/
users-db-total.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
apiVersion: v1
kind: Service
metadata:
name: users-mongo
labels:
app: acmefit
service: users-mongo
spec:
ports:
- port: 27017
name: mongo-users
protocol: TCP
selector:
app: acmefit
service: users-mongo
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: users-mongo
labels:
app: acmefit
service: users-mongo
spec:
selector:
matchLabels:
app: acmefit # has to match .spec.template.metadata.labels
service: users-mongo
replicas: 1
template:
metadata:
labels:
app: acmefit # has to match .spec.selector.matchLabels
service: users-mongo
spec:
containers:
- name: users-mongo
image: mongo:4
resources:
{}
ports:
- name: users-mongo
containerPort: 27017
protocol: "TCP"
env:
- name: MONGO_INITDB_ROOT_USERNAME
value: 'mongoadmin'
- name: MONGO_INITDB_DATABASE
value: 'acmefit'
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: users-mongo-pass
key: password
volumeMounts:
- mountPath: /data/db
name: mongodata
- mountPath: /docker-entrypoint-initdb.d
name: mongo-initdb
volumes:
- name: mongodata
emptyDir: {}
- name: mongo-initdb
configMap:
name: users-initdb-config
# - name: mongodata
# persistentVolumeClaim:
# claimName: mongodata