Defining runnerToken doesn't work
Summary
Using the Helm Chart to install the runner onto Kubernetes with the value 'runnerToken' filled in of an existing runner doesn't work. When inputting the runnerToken the runner will with the message:
ERROR: Verifying runner... is removed runner=aBcabC
Steps to reproduce
Install the Helm chart using the following values:
unregisterRunners: false
runnerRegistrationToken: <snip>
When the runner starts, grab the runner token:
Checking for jobs... nothing runner=aBcabC
Feeding runners to channel builds=0
Adjust the helm template to add the value:
runnerToken : aBcabC
Runner will start with the message:
ERROR: Verifying runner... is removed runner=aBcabC
Actual behavior
ERROR: Verifying runner... is removed runner=aBcabC
Expected behavior
The runner successfully registering with the same Token as before.
Relevant logs and/or screenshots
Registration attempt 1 of 30
Runtime platform arch=amd64 os=linux pid=16 revision=a987417a version=12.2.0
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...
Token specified trying to verify runner...
WARNING: If you want to register use the '-r' instead of '-t'.
ERROR: Verifying runner... is removed runner=aBcabC
PANIC: Failed to verify this runner. Perhaps you are having network problems
Environment description
We are using own runners on our own Kubernetes cluster installed using the official Helm chart.
The values used for the helm chart are as follow:
image: gitlab/gitlab-runner:alpine-v12.2.0
gitlabUrl: https://gitlab.com/
runnerRegistrationToken: "something"
logLevel: debug
## Unregister all runners before termination
##
## Updating the runner's chart version or configuration will cause the runner container
## to be terminated and created again. This may cause your Gitlab instance to reference
## non-existant runners. Un-registering the runner before termination mitigates this issue.
## ref: https://docs.gitlab.com/runner/commands/README.html#gitlab-runner-unregister
##
unregisterRunners: false
runnerToken: "aBcabC"
rbac:
create: true
clusterWideAccess: true
runners:
image: custom/image:tag
imagePullSecrets:
- registry-secret
# Build tags
tags: kubernetes,shared-cluster,acceptance
## Specify whether the runner should be locked to a specific project: true, false. Defaults to true.
##
locked: false
## Specify if jobs without tags should be run.
## If not specified, Runner will default to true if no tags were specified. In other case it will
## default to false.
##
## ref: https://docs.gitlab.com/ce/ci/runners/#allowing-runners-with-tags-to-pick-jobs-without-tags
##
runUntagged: false
## Run all containers with the privileged flag enabled
## This will allow the docker:dind image to run if you need to run Docker
## commands. Please read the docs before turning this on:
## ref: https://docs.gitlab.com/runner/executors/kubernetes.html#using-docker-dind
##
privileged: true
cache:
# General settings
cacheType: gcs
cachePath: "gitlab_runner"
cacheShared: true
# GCS settings
gcsBucketName: name-of-bucket
# Use this line for access using access-id and private-key
secretName: gcs-cache-auth
metrics:
enabled: true
Used GitLab Runner version
Running with gitlab-runner 12.2.0 (a987417a)
Possible fixes
Disable runnerToken and unregisterRunners. This will register a new token every time.