Add cell routing info to new runner tokens
What does this MR do and why?
This MR changes the logic that computes authentication tokens for new runners, to include routing info that can later be used by the router to decide to which cell to forward an unauthenticated API request to.
cell | old token | new token | short sha version |
---|---|---|---|
1 | glrt-UfMt7-xxxxxx-ZJpuvsb |
glrt-cell_1_UfMt7-xxxxxx-ZJpuvsb |
UfMt7-xxx |
1 | UfMt7-xxxxxx-ZJpuvsb |
cell_1_UfMt7-xxxxxx-ZJpuvsb |
UfMt7-xxx |
2 | glrt-UfMt7-xxxxxx-ZJpuvsb |
glrt-cell_2_UfMt7-xxxxxx-ZJpuvsb |
UfMt7-xxx |
2 | UfMt7-xxxxxx-ZJpuvsb |
cell_2_UfMt7-xxxxxx-ZJpuvsb |
UfMt7-xxx |
Closes #458419 (closed)
There is a matching MR on the GitLab Runner side to have it ignore the cell routing info when computing a short sha token: gitlab-runner!4746 (closed)
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After |
---|---|
This request would have gone to cell 1, which would not recognize the token: |
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
-
Run the following command to provide a cell prefix to your GDK installation (from https://gitlab.com/gitlab-org/tenant-scale-group/pocs/routing/rules-router#step-1-gdk-1):
gdk config set gitlab.rails.session_store.session_cookie_token_prefix cell_2_ gdk reconfigure gdk restart
-
Create a new runner at http://gdk.test:3000/admin/runners/new
-
Confirm that the generated runner token contains the configured cell prefix.