Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
EOLE
hackathon-kubernetes
Commits
1f928405
Commit
1f928405
authored
Nov 21, 2018
by
Matthieu Lamalle
Browse files
mongodb
parent
14219833
Changes
1
Hide whitespace changes
Inline
Side-by-side
kubernetes/mongodb/mongodb-deployment.yml
0 → 100644
View file @
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment