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 have 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, type your key in
Pool name and click Create pool. The field starts empty and shows
self-hosted as a placeholder. If a pool already has that name, it shows the
next free one: self-hosted-2, then self-hosted-3, and so on. If you leave
the field empty, Create pool creates the pool with the name shown. The name
is permanent, so choose it before you click. 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 used 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 that still use the old token stop with exit code 3. On each one, save
the new token and start the host again:
spotlight host config set token=<new pool token>
spotlight host startspotlight host status then shows whether Spotlight accepts the token.
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.