Target nodes spec
Target nodes spec
You can choose whether a job is run on a node or nodes by specifying tags and a count of target nodes having this tag do you want a job to run.
The target node syntax: [tag-value]:[count]
Examples:
Target all nodes with a tag:
{
"name": "job_name",
"command": "/bin/true",
"schedule": "@every 2m",
"tags": {
"my_role": "web"
}
}
graph LR;
J("Job tags: #quot;my_role#quot;: #quot;web#quot;") -->|Run Job|N1["Node1 tags: #quot;my_role#quot;: #quot;web#quot;"]
J -->|Run Job|N2["Node2 tags: #quot;my_role#quot;: #quot;web#quot;"]
J -->|Run Job|N3["Node2 tags: #quot;my_role#quot;: #quot;web#quot;"]
Target only one nodes of a group of nodes with a tag:
{
"name": "job_name",
"command": "/bin/true",
"schedule": "@every 2m",
"tags": {
"my_role": "web:1"
}
}
graph LR;
J("Job tags: #quot;my_role#quot;: #quot;web:1#quot;") -->|Run Job|N1["Node1 tags: #quot;my_role#quot;: #quot;web#quot;"]
J -.- N2["Node2 tags: #quot;my_role#quot;: #quot;web#quot;"]
J -.- N3["Node2 tags: #quot;my_role#quot;: #quot;web#quot;"]
Dkron will try to run the job in the amount of nodes indicated by that count having that tag.