Please explain global scope

What exactly are you looking for?

A replicated service will have the number of desired replicas, though without any guaranty that those instances are spread accross all available nodes matching the placement contraints. A good example is anything that has some sort of replicated/quorum based state, where a fixed number of instances needs to be run.

A global service on the other hand will have a single instance per node that matches the placement contraint. A good usecase for this is a node based agent (like the portainer agent) or a reverse proxy (like traefik) especialay if the instances bind the host ports instead of using the ingress mesh. Be aware that a global service will be deployed on new nodes matching the placement constraint as soon as they join your swarm.

Of course both could be used with stateless services as well.

1 Like