0

I have a swarm with 1 manager and 2 nodes (worker 1, worker 2).

On manager and worker 1 I have 30+ services replicated between them, one of which is mysql.

On worker 2 I want to set up a mysql slave to worker 1's mysql.

However, I would like worker 2 to only be available for the mysql service, and not for any of the other services.

I could accomplish this by adding deployment constraints to every service that I don't want to replicate to worker 2, but to alter 30+ services and add a constraint for each of them seems laborious and a bit messy.

Is there an elegant way to achieve this?

leo_cape
  • 141
  • 3
  • 14

1 Answers1

0

True, the approach is cumbersome and the overhead is hard to accept. Though, for time beeing there is no other option to achive this with Swarm deployments.

If you'd be willing to migrate from Swarm to Kubernetes, then taints and tolerations would do what you need.

Metin
  • 661
  • 3
  • 15