I am running GitLab Runner
using a Helm
chart as described on the GitLab Runner Helm Chart page.
Everything seems to be working, but after about two months of running I see on my GitLab
group that controls the GitLab runner
on the "CI / CD Settings|Runners" page the message
"Available group Runners: 54".
Here is the first couple on that page:
Rather than listing all 54 here is the list run through uniq -c
:
3 gitlab-runner-gitlab-runner-9fcb644b9-4f5ss
2 gitlab-runner-gitlab-runner-9fcb644b9-4gqqq
1 gitlab-runner-gitlab-runner-9fcb644b9-889rc
2 gitlab-runner-gitlab-runner-9fcb644b9-grb5j
1 gitlab-runner-gitlab-runner-9fcb644b9-hhv8f
1 gitlab-runner-gitlab-runner-9fcb644b9-kzcdv
13 gitlab-runner-gitlab-runner-9fcb644b9-nvrms
7 gitlab-runner-gitlab-runner-9fcb644b9-pl2k4
2 gitlab-runner-gitlab-runner-9fcb644b9-sxlmp
9 gitlab-runner-gitlab-runner-9fcb644b9-vdmsj
3 gitlab-runner-gitlab-runner-9fcb644b9-vgdnv
8 gitlab-runner-gitlab-runner-9fcb644b9-wst8q
2 gitlab-runner-gitlab-runner-9fcb644b9-xnzhx
Looking at my GitLab Runner
Kubernetes
container there seems to be only one runner:
$ /usr/bin/gitlab-runner list
Runtime platform arch=amd64 os=linux pid=4953 revision=1b659122 version=12.8.0
Listing configured runners ConfigFile=/home/gitlab-runner/.gitlab-runner/config.toml
gitlab-runner-gitlab-runner-9fcb644b9-grb5j Executor=kubernetes Token=XXXXXXXXXXXX-XXXXX URL=https://myserver.example.com/
Another potentially important piece of information: the Kubernetes
node that hosts the GitLab Runner
container is preemptible meaning it gets killed and restarted about every 24 hours.
How do I convince GitLab
that these old runners are not still around? And how do I avoid this problem in the future?