-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathmongodb.yml
40 lines (40 loc) · 873 Bytes
/
mongodb.yml
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
apiVersion: apps/v1
kind: Deployment
metadata:
name: review-mongodb
labels:
app: review-mongodb
spec:
replicas: 1
selector:
matchLabels:
app: review-mongodb
template:
metadata:
labels:
app: review-mongodb
spec:
containers:
- name: review-mongodb
image: mongo:6.0.4 # Latest stable MongoDB version
ports:
- containerPort: 27017
volumeMounts:
- name: mongodb-storage
mountPath: /data/db
volumes:
- name: mongodb-storage
emptyDir: {} # Use PersistentVolumeClaim for production
---
apiVersion: v1
kind: Service
metadata:
name: review-mongodb
spec:
selector:
app: review-mongodb
ports:
- protocol: TCP
port: 27017
targetPort: 27017
type: ClusterIP # Change to LoadBalancer or NodePort if needed