Worker
An Worker is a Linux machine identified by its IP address and labels, defined in workers.json
.
Maand uses SSH for communication, requiring user permissions and specific configurations.
Prerequisites
-
User Permissions The SSH user (e.g.,
worker
) must have:- Non-interactive command execution privileges.
- Sudo/root access for administrative tasks.
-
Key File Place the private SSH key (e.g.,
worker.key
) in thesecrets
folder.
Configuration Steps
-
Place Key File Move the
worker.key
file to thesecrets
directory:platform-services/secrets/worker.key
Example Folder Structure
. ├── data │ └── maand.db ├── logs │ └── maand.log ├── maand.conf ├── secrets │ ├── ca.crt │ └── ca.key │ └── worker.key <============================== └── workspace ├── workers.json └── maand.jobs.conf
-
Update
maand.conf
Configure SSH details inmaand.conf
:[default] ca_ttl = 3650 # Certificate Authority validity use_sudo = 1 # Enable sudo for privileged tasks ssh_user = worker # SSH user ssh_key = secrets/worker.key # Path to private SSH key
-
Install Tools on Workers Ensure each agent has the following installed:
rsync
,make
,docker
,docker-compose
,python3
.
Defining Workers
- Create the
workers.json
file inworkspace/
:[ { "host": "10.27.221.181" }, { "host": "10.27.221.144" }, { "host": "10.27.221.170" } ]
Verify Setup
-
Build Workspace Compile the changes: use build command always whenever changes made to workspace folder.
$ maand build
-
Verify Connectivity Test communication with workers:
$ maand run_command 'uptime' [10.27.221.181] 14:39:54 up 1:06, load average: 0.11, 0.07, 0.01 [10.27.221.170] 14:39:54 up 1:06, load average: 0.03, 0.08, 0.08 [10.27.221.144] 14:39:54 up 1:06, load average: 0.12, 0.05, 0.01
Your setup is complete, and Maand is ready to orchestrate jobs across your workers.