docsite/docs/swarm.md
Komodo can manage Docker Swarm clusters through the Swarm resource. Connect your swarm manager nodes and manage nodes, services, stacks, configs, and secrets from a single interface.
A Swarm resource points to one or more manager nodes — these are Servers that already have Periphery installed and are part of a Docker Swarm as managers. If one manager is unreachable, Komodo will try the next one in the list.
[[swarm]]
name = "production-swarm"
[swarm.config]
server_ids = ["manager-01", "manager-02", "manager-03"]
send_unhealthy_alerts = true
| Field | Description | Default |
|---|---|---|
servers | List of Swarm manager Server names/IDs. Tries each sequentially on failure. | [] |
send_unhealthy_alerts | Send alerts when nodes or tasks are unhealthy. | true |
maintenance_windows | Scheduled windows during which alerts are suppressed. | [] |
links | Quick links displayed in the resource header. | [] |
To use Docker Swarm with Komodo, you first need to initialize a swarm on one of your connected servers.
SSH into your server (or use a Komodo terminal) and run docker swarm init:
docker swarm init --advertise-addr <SERVER_IP>
Create a new Swarm resource and add the server as a manager node. Once created, Komodo will detect the swarm and display its nodes.
To add more servers to the swarm, navigate to the Swarm's node list in the UI and click the Join button. This will display the docker swarm join command with the correct token and address — copy it and run it on the server you want to add.
There are separate join commands for worker and manager nodes.
:::tip
After a node joins, add it as a Server in Komodo and (for managers) include it in the Swarm resource's servers list for redundancy.
:::
View all nodes in the swarm with their role, availability, status, and other information.
Swarm services can be managed directly, or created from
Deployment resources by configuring swarm instead of server in the Deployment config.
Deploy compose-based stacks to the swarm using docker stack deploy.
Stack resources can target a Swarm by configuring swarm instead of server in the Stack config.
Manage Docker Swarm configs and secrets directly from Komodo.
:::note Configs and secrets have a maximum size of 500KB. :::
Komodo tracks the overall health of each Swarm:
| State | Meaning |
|---|---|
| Healthy | All nodes and tasks are OK. |
| Unhealthy | Some nodes or tasks don't match the desired state. |
| Down | All nodes or tasks are down. |
| Unknown | Status cannot be determined. |
When send_unhealthy_alerts is enabled, Komodo will route alerts through your configured Alerters.
Both Deployments and Stacks can target a Swarm instead of a single Server:
swarm to deploy the container as a Swarm service. You can attach swarm configs and secrets to the service.swarm to deploy via docker stack deploy instead of docker compose up.