added k8s files and jenkinsfile

This commit is contained in:
tusuii
2026-03-10 22:39:47 +05:30
parent 74918d251f
commit 57a2968d74
22 changed files with 767 additions and 1 deletions

View File

@@ -0,0 +1,45 @@
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: mongodb
namespace: database
spec:
serviceName: mongodb
replicas: 1
selector:
matchLabels:
app: mongodb
template:
metadata:
labels:
app: mongodb
spec:
containers:
- name: mongodb
image: mongo:7
ports:
- containerPort: 27017
volumeMounts:
- name: mongodb-data
mountPath: /data/db
livenessProbe:
exec:
command:
- mongosh
- --eval
- "db.adminCommand('ping')"
initialDelaySeconds: 30
periodSeconds: 10
failureThreshold: 6
readinessProbe:
exec:
command:
- mongosh
- --eval
- "db.adminCommand('ping')"
initialDelaySeconds: 5
periodSeconds: 5
volumes:
- name: mongodb-data
persistentVolumeClaim:
claimName: mongodb-pvc