Commit b7361d66 authored by Luc Bourdot's avatar Luc Bourdot
Browse files

Merge branch 'mongodb' into 'master'

mongodb

See merge request !3
parents d4018825 1f928405
kind: Deployment
apiVersion: extensions/v1beta1 # for versions before 1.9.0 use apps/v1beta2
metadata:
name: mongodb
labels:
service: mongodb
spec:
replicas: 1
strategy: {}
selector:
matchLabels:
service: mongodb
replicas: 1 # tells deployment to run 2 pods matching the template
template:
metadata:
labels:
service: mongodb
spec:
containers:
- env:
- name: MONGO_DATA_DIR
value: /data/db
- name: MONGO_LOG_DIR
value: /dev/null
name: mongodb
image: mongo:latest
command: ['/bin/bash']
args: ["-c", "mongod --smallfiles --logpath=/dev/null"]
ports:
- containerPort: 8081
name: mongodb
protocol: TCP
resources: {}
volumes:
- name: mongodb-data
persistentVolumeClaim:
claimName: mongodb-data
- name: mongodb-save
persistentVolumeClaim:
claimName: mongodb-save
---
kind: Service
apiVersion: v1
metadata:
name: mongodb
spec:
type: NodePort
selector:
service: mongodb
ports:
- port: 8081
targetPort: 8081
protocol: TCP
---
# Persistent Volume Claim
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: local-storage
status: {}
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: mongodb-save
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 200Mi
storageClassName: local-storage
status: {}
---
# Persistent volumes
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-data
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-data
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- matthieu-pc
---
apiVersion: v1
kind: PersistentVolume
metadata:
name: mongodb-save
spec:
capacity:
storage: 500Mi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Delete
storageClassName: local-storage
local:
path: /tmp/mongodb-save
nodeAffinity:
required:
nodeSelectorTerms:
- matchExpressions:
- key: kubernetes.io/hostname
operator: In
values:
- matthieu-pc
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment