Affinity rule to distribute instances by hosts, preventing run more than one by host.
This commit is contained in:
parent
feb0eac179
commit
93bdc8d5a8
@ -11,6 +11,7 @@ services:
|
|||||||
- "${replset_name}"
|
- "${replset_name}"
|
||||||
image: mongo:3.4
|
image: mongo:3.4
|
||||||
labels:
|
labels:
|
||||||
|
io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||||
io.rancher.scheduler.affinity:host_label: ${host_label}
|
io.rancher.scheduler.affinity:host_label: ${host_label}
|
||||||
io.rancher.container.hostname_override: container_name
|
io.rancher.container.hostname_override: container_name
|
||||||
io.rancher.sidekicks: mongo-base, mongo-datavolume
|
io.rancher.sidekicks: mongo-base, mongo-datavolume
|
||||||
@ -22,6 +23,7 @@ services:
|
|||||||
mongo-base:
|
mongo-base:
|
||||||
restart: always
|
restart: always
|
||||||
labels:
|
labels:
|
||||||
|
io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||||
io.rancher.scheduler.affinity:host_label: ${host_label}
|
io.rancher.scheduler.affinity:host_label: ${host_label}
|
||||||
io.rancher.container.hostname_override: container_name
|
io.rancher.container.hostname_override: container_name
|
||||||
io.rancher.container.start_once: true
|
io.rancher.container.start_once: true
|
||||||
@ -30,6 +32,7 @@ services:
|
|||||||
entrypoint: /bin/true
|
entrypoint: /bin/true
|
||||||
mongo-datavolume:
|
mongo-datavolume:
|
||||||
labels:
|
labels:
|
||||||
|
io.rancher.scheduler.affinity:container_label_ne: io.rancher.stack_service.name=$${stack_name}/$${service_name}
|
||||||
io.rancher.scheduler.affinity:host_label: ${host_label}
|
io.rancher.scheduler.affinity:host_label: ${host_label}
|
||||||
io.rancher.container.hostname_override: container_name
|
io.rancher.container.hostname_override: container_name
|
||||||
io.rancher.container.start_once: true
|
io.rancher.container.start_once: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user