gitlab-K8S/Executor - how to re-use existing instance (runnerToken vs runnerRegistrationToken)

gitlab runs on EC2 instance and executors and runners on Kubernetes.
gitlab: 13.2.1-ee
K8S: 1.17

  • What are you seeing, and how does that differ from what you expect to see?
    We have working environment right now - k8s/gitlab executor is registered and getting/executing jobs (via runners). We got inside executor pod/container and got the runnerToken from (config.toml). Instead of registering a new executor everytime there is a change to be applied (using runnerRegistrationToken) we wanted instead to use (runnerToken) as to reuse the existing instance. Else, we end up with long list of orphans executors (and have to manually update certain cfg on newly registered executor).

runnerRegistrationToken: {runner_reg_token} vs runnerToken: {runner_token}

problem: the pod gets deployed though executor gets forbidden a few times and based on CLI error - states that gets disabled.

We were not able to find much documentation on runnerToken and how to properly configure for it. So, in need of some help, please.

goal is rather simple: apply configuration changes to executor and reutilize existing instance as opposed to keep on registering new instances.

Thanks /Pedro

I figured it out though remains 2 questions/problems. first, the catch: unregisterRunners: ${unregister_runners} was not passed. Overlooked that default is true, therefore updated chart and now can make chart or cfg change and reuse existing instance. Perhaps documentation should explicitly mention that in order to use runner_token, one will need to pass unregisterRunners: false.

2 questions/problems with this approach:

a. runner description (gitlab UI) will always be the one that originally registered (hp4fw) even though it is long gone (changes to chart/cfg leads one to be terminated and new one to be created). Moreover, there is an open bug reported already that it is not possible to search runner based on sliced token in the UI :frowning:
gitlab-runner-gitlab-runner-54cf7679d8-hp4fw 1/1 Terminating
gitlab-runner-gitlab-runner-557f68fc45-k9gsr 1/1 Running

b. hp4fw was registered and had, among other things, REGISTER_RUN_UNTAGGED=true and validated that. However when I changed that (chart) from true => false and applied, then k9gsr gets created. env variable is properly set though gitlab UI (searching on hp4fw - see problem a. above go understand why) still shows it ‘true’.

Good news is that we can make chart/cfg changes without having to register new instances now though came across the above problems which makes it quite confusing. Please advise/help. thanks /Pedro