moby / swarmkit

A toolkit for orchestrating distributed systems at any scale. It includes primitives for node discovery, raft-based consensus, task scheduling and more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Placement constraints

darkl0rd opened this issue · comments

What I want to achieve:

Ensure replicas are spread across availability zones and never run in the same.

current approach:

I am currently doing this through placement preferences.

The problem:

However, they are that. Preferences. If one zone becomes unavailable, the other replica will be scheduled in the other zone which already contains a replica.

This is particularly troublesome, as the service is backed by persistent storage (ebs), which is not replicated across availability zones; meaning that the replica will start up with an empty volume in that zone.

Is it possible to set a placement preference similar to how constraints work? So that I can guarantee a (one) replica will always run in a distinct zone, if the other zone is not available then do not start the replica? If not, is there an alternative way of achieving this?

Possible workaround: Use two services service_AZ1 and service_AZ2 that both have the same network alias and then route to the network alias?

However, they are that. Preferences. If one zone becomes unavailable, the other replica will be scheduled in the other zone which already contains a replica.

This is why I implemented --replicas-max-per-node couple of years ago. However it requires that requires to be combined with constraint in way that if you want only have one replica per zone then there can be only one possible node for it per zone.

Curious though, is there any ongoing development on Swarmkit? Or is it (mostly) abandoned due to Kubernetes?

Kubernetes has become industry standard so most of the developers are focusing to it. However there is still some development going on swarmkit side too time to time, depending how people are interested about it. I example just created one PR #3072 so it is interesting to see if that gets merged.

Issue about swarm roadmap can be found from #2665