Allow registration of runners via API
Description
Setting up a GitLab CI runner requires an admin to retrieve the GitLab CI registration token from the admin dashboard. This means the runner cannot be automatically deployed without pre-setting the runners token as an ENV var or in config.toml
.
Update from 2021-12-01 (discussion): User can get the runners_token
field of a group or project to register a group or project runner. However there is no API request to get runner registration token for instance. !68590 (merged) added ability to reset tokens via API, however it would be destructive to get instance token by resetting it. Per comment in #16319 (comment 749458561) - Existing runners would continue to work fine, but registering new ones with the old token would fail. So, it would potentially affect other users, but not other registered runners.
Proposal
Create API endpoint to get instance registration token for runners.
Proposal before 2021-12-01 update
Provide an API endpoint to register a runner by POSTing to /runners with a PAT:
- Admin would be allowed to register any kind of runner: shared or project/group specific
- User would be allowed to register only project/group specific runner if he has master access
Links / references
This page may contain information related to upcoming products, features and functionality. It is important to note that the information presented is for informational purposes only, so please do not rely on the information for purchasing or planning purposes. Just like with all projects, the items mentioned on the page are subject to change or delay, and the development, release, and timing of any products, features, or functionality remain at the sole discretion of GitLab Inc.