Skip to main content

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.

  1. Open your application in the Appliku dashboard
  2. Go to SettingsBuild
  3. Check Allow placement on manager nodes
  4. Save
  5. 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.

note

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).

  1. Open your application
  2. Go to the Processes tab
  3. Edit the process
  4. Set Placement constraints -- one constraint per line (for example, node.role == worker or node.labels.disk == ssd)
  5. 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):

  1. Per-process placement constraints -- used verbatim if set on the process.
  2. Default cluster constraint (node.role == worker) -- applied when the cluster has worker nodes and Allow placement on manager nodes is off.
  3. No constraint -- applied when the cluster has no worker nodes, or when Allow placement on manager nodes is on.

Next Steps