- Controlling update parallelism
- Creating replicated services
- Running services in global mode
- Constraining services to specific nodes
1. Update Parallelism
By default, Swarm updates one task at a time. Adjusting the update parallelism speeds up rollouts or rollbacks across many tasks.--update-parallelism:
UpdateConfig.Parallelism: 2 while the rollback parallelism remains unchanged.
Increasing
--update-parallelism accelerates rollouts but may spike resource usage. Tune based on your cluster capacity.2. Replicated Service
A replicated service ensures a fixed number of identical tasks across the swarm.3. Global Service
Global mode deploys exactly one task per active node. When nodes join or leave, tasks are added or removed automatically.4. Placement Constraints
Placement constraints let you target services to nodes with specific labels.-
Label the node (replace
<NODE_ID>): -
Verify the label:
-
Create the constrained service:
env=dev.
If no nodes match the constraint, the service remains pending. Always verify labels before deployment.