Placement Constraints
Placement constraints let you control which Docker Swarm nodes are eligible to run your application's workloads. This page explains the default behavior for cluster-mode apps in Appliku and how to adjust it.
Placement constraints apply only to cluster deployments. Standalone server deployments run on a single server and have no placement logic.
Default Behavior
When Appliku generates the docker-compose.yml for a cluster deployment, it chooses a default placement automatically based on the topology of your cluster:
- Cluster has worker nodes -- All application services are constrained to
node.role == worker. Manager nodes are reserved for the Swarm control plane and are not used for workload placement. - Cluster has no worker nodes (single-node / manager-only clusters) -- No placement constraint is applied. Docker schedules workloads on the available manager node.
The same rule applies to one-off commands (for example, the release command): when the default worker constraint is in effect, the generated docker service create call adds --constraint 'node.role == worker'; otherwise the constraint is omitted.
Allow Placement on Manager Nodes
Some teams want manager nodes to carry workload alongside workers -- for example, to get more out of a small cluster without maintaining a separate dedicated manager. Appliku exposes a per-application toggle for this.
- Open your application in the Appliku dashboard
- Go to Settings → Build
- Check Allow placement on manager nodes
- Save
- Redeploy the application for the change to take effect
When this option is enabled, Appliku skips the default node.role == worker constraint even when worker nodes are present. Docker Swarm then considers every node in the cluster -- managers and workers -- when scheduling the application's services.
This flag is only meaningful for cluster-mode applications. It has no effect on standalone server deployments.
Per-Process Placement Constraints
For fine-grained control, each process can carry its own placement constraints that override the cluster-wide default. This is useful when some processes should be pinned to specific nodes (for example, a process that needs a node labeled disk=ssd).
- Open your application
- Go to the Processes tab
- Edit the process
- Set Placement constraints -- one constraint per line (for example,
node.role == workerornode.labels.disk == ssd) - Save and redeploy
Per-process constraints take priority over the application-wide default, so a process with explicit constraints is unaffected by the "Allow placement on manager nodes" toggle.
Priority Summary
For each service in the generated docker-compose.yml, placement is decided in this order (highest wins):
- Per-process placement constraints -- used verbatim if set on the process.
- Default cluster constraint (
node.role == worker) -- applied when the cluster has worker nodes andAllow placement on manager nodesis off. - No constraint -- applied when the cluster has no worker nodes, or when
Allow placement on manager nodesis on.
Next Steps
- Deploying to a Cluster -- Full deployment workflow
- Scaling in Clusters -- Scale individual processes across nodes
- Cluster Limitations -- Constraints to be aware of