54 lines
1.3 KiB
YAML
54 lines
1.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: StatefulSet
|
|
metadata:
|
|
name: mongodb
|
|
namespace: ecommerce
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
serviceName: mongodb
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: mongodb
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: mongodb
|
|
spec:
|
|
securityContext:
|
|
fsGroup: 999
|
|
containers:
|
|
- name: mongodb
|
|
image: mongo:7
|
|
ports:
|
|
- containerPort: 27017
|
|
env:
|
|
- name: MONGO_INITDB_DATABASE
|
|
value: "vaishnavi_products"
|
|
volumeMounts:
|
|
- name: mongodb-data
|
|
mountPath: /data/db
|
|
resources:
|
|
requests:
|
|
cpu: "100m"
|
|
memory: "256Mi"
|
|
limits:
|
|
cpu: "500m"
|
|
memory: "512Mi"
|
|
readinessProbe:
|
|
exec:
|
|
command: [mongosh, --eval, "db.adminCommand('ping')", --quiet]
|
|
initialDelaySeconds: 15
|
|
periodSeconds: 5
|
|
failureThreshold: 6
|
|
livenessProbe:
|
|
exec:
|
|
command: [mongosh, --eval, "db.adminCommand('ping')", --quiet]
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
volumes:
|
|
- name: mongodb-data
|
|
persistentVolumeClaim:
|
|
claimName: mongodb-data
|