Create a pull pool and get its token
A host claims work with its pool's token. To create the pool you need to be an
owner or admin of the workspace, or to hold a
workspace token with the runners
scope. Spotlight keeps only a hash of the token, so store the value as soon as
you have it.
Create the pool
Choose a key of lowercase words joined by dashes, such as build-machines. It
can't be changed later.
On the Runners page, click Add a host, or Add the first host while
no host serves the workspace. Under Create a pool, Pool name suggests
my-computer-1, or the next free number. Replace it with your key and click
Create pool. The next step shows the install command with the token already
in it, and Copy command copies it. The token is shown only this once.
The web app only creates pools. To label a pool, limit its runs or rotate its token, use Terraform or the resource API.
Label the pool
If lines should be able to send work to this pool in particular, give it
labels. In Terraform, add labels = ["linux"]; in the API body, add
"labels": ["linux"]. Send a line's work to particular runners
shows how lines name them.
Limit how many runs it takes
If the pool should serve only so many runs at once, however many hosts serve
it, set max_runs in Terraform or maxRuns in the API.
spotlight_runner_pool
gives its range.
Rotate the token
Use a token no pool has held before. The old one stops working at once, and runs already claimed carry on.
Raise token_version in the locals, for example to 2. Because the locals are
the password's keepers, terraform apply generates a new password and sends
it with the new version. Read it again with terraform output.
Hosts still holding the old token stop with exit code 3. Give each one the
new token in SPOTLIGHT_TOKEN in its host.env, and
restart it.
Related
- Install a host
- Run hosts without a stored token, for hosts on a platform that issues workload tokens.
- Pool token: the rules a pool token follows.