-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongo-deployment.yaml
71 lines (71 loc) · 1.52 KB
/
mongo-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
71
apiVersion: apps/v1
kind: Deployment
metadata:
name: node-ms-mongodb-deployment
labels:
app: node-ms-mongodb
spec:
replicas: 1
selector:
matchLabels:
app: node-ms-mongodb
template:
metadata:
labels:
app: node-ms-mongodb
spec:
containers:
- name: node-ms-mongodb
image: mongo
ports:
- containerPort: 27017
env:
- name: MONGO_INITDB_ROOT_USERNAME
valueFrom:
secretKeyRef:
name: mongodb-secret
key: MONGO_INITDB_ROOT_USERNAME
- name: MONGO_INITDB_ROOT_PASSWORD
valueFrom:
secretKeyRef:
name: mongodb-secret
key: MONGO_INITDB_ROOT_PASSWORD
- name: MONGO_INITDB_DATABASE
value: node-ms-mongodb
# volumeMounts:
# - name: storage
# mountPath: /data/db
# resources:
# requests:
# memory: "64Mi"
# cpu: "250m"
# limits:
# memory: "128Mi"
# cpu: "500m"
# volumes:
# - name: storage
# persistentVolumeClaim:
# claimName: mongo-pvc
---
apiVersion: v1
kind: Service
metadata:
name: node-ms-mongodb-service
spec:
selector:
app: node-ms-mongodb
ports:
- protocol: TCP
port: 27017
targetPort: 27017
---
# apiVersion: v1
# kind: PersistentVolumeClaim
# metadata:
# name: mongo-pvc
# spec:
# accessModes:
# - ReadWriteOnce
# resources:
# requests:
# storage: 256Mi