gocd-contrib/docker-swarm-elastic-agent-plugin

Add support for constraints in profile

ketan opened this issue · 0 comments

ketan commented

I'm running a swarm with nodes running on centos 7 and windows 2016 server. When I schedule a service, it usually "bounces" between various hosts because a windows container when scheduled on a linux host fails and gets re-assigned to another host until it is assigned to a windows host. Similar thing happens when a linux container is scheduled on a windows host. Depending on the number of bounces, it can take several seconds for the container to come up.

In such mixed-os swarm clusters, it is recommended that:

  • each node be "tagged" with a label:
    docker node update --label-add "os=[windows|linux]"
  • when scheduling a particular service, apply a constraint to run on a specific node(s):
    docker service create --constraint 'node.labels.os==windows'