Prevent scheduling scaled containers on same host

Given it appears the default behavior is to prefer (but not require) to not have containers of the same Service scheduled to the same host.

Is there a way to require containers are not scheduled to the same host? In the case that you have volumes based on local paths, it seems important for service containers to not share the same local files in some cases (e.g. databases etc).

Believe I figured out a way to do this e.g:


    es4: 'true'
    io.rancher.scheduler.affinity:container_label_ne: es4=true
  tty: true
  image: elasticsearch
  - /data/es-demo4:/data/es-demo4
  stdin_open: true

Note the label es4=true and the scheduling requirement that there must not be another container with the label es4=true.