Choose specific host label to deploy the MongoDB cluster..

This commit is contained in:
Martin Evgeniev
2016-05-30 11:03:20 +02:00
parent c0a58df49d
commit 1d858d8f55
3 changed files with 83 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
mongo-cluster:
restart: always
environment:
MONGO_SERVICE_NAME: mongo-cluster
tty: true
entrypoint: /opt/rancher/bin/entrypoint.sh
command:
- --replSet
- "${replset_name}"
image: mongo:3.2
labels:
io.rancher.scheduler.affinity: "${host_label}"
io.rancher.container.hostname_override: container_name
io.rancher.sidekicks: mongo-base, mongo-datavolume
volumes_from:
- mongo-datavolume
- mongo-base
mongo-base:
restart: always
net: none
tty: true
labels:
io.rancher.scheduler.affinity: "${host_label}"
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
image: rancher/mongodb-conf:v0.1.0
stdin_open: true
entrypoint: /bin/true
mongo-datavolume:
net: none
labels:
io.rancher.scheduler.affinity: "${host_label}"
io.rancher.container.hostname_override: container_name
io.rancher.container.start_once: true
volumes:
- /data/db
entrypoint: /bin/true
image: busybox