43 lines
804 B
YAML
43 lines
804 B
YAML
|
# mongo-deployment.yml
|
||
|
apiVersion: apps/v1
|
||
|
kind: Deployment
|
||
|
metadata:
|
||
|
name: mongo
|
||
|
labels:
|
||
|
app: mongo
|
||
|
spec:
|
||
|
replicas: 1
|
||
|
selector:
|
||
|
matchLabels:
|
||
|
app: mongo
|
||
|
template:
|
||
|
metadata:
|
||
|
labels:
|
||
|
app: mongo
|
||
|
spec:
|
||
|
containers:
|
||
|
- name: mongo
|
||
|
image: mongo:latest
|
||
|
ports:
|
||
|
- containerPort: 27017
|
||
|
volumeMounts:
|
||
|
- name: mongo-persistent-storage
|
||
|
mountPath: /data/db
|
||
|
- name: mongo-persistent-storage
|
||
|
mountPath: /data/configdb
|
||
|
volumes:
|
||
|
- name: mongo-persistent-storage
|
||
|
persistentVolumeClaim:
|
||
|
claimName: mongo-pvc
|
||
|
---
|
||
|
apiVersion: v1
|
||
|
kind: PersistentVolumeClaim
|
||
|
metadata:
|
||
|
name: mongo-pvc
|
||
|
spec:
|
||
|
accessModes:
|
||
|
- ReadWriteOnce
|
||
|
resources:
|
||
|
requests:
|
||
|
storage: 1Gi
|