added required k8s and docker file

This commit is contained in:
tusuii
2026-02-19 18:09:25 +05:30
parent 09ea6d4efb
commit 173293efaa
17 changed files with 405 additions and 0 deletions

View File

@@ -0,0 +1,53 @@
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