Current GitLab version: 18.1.3 ; OS: Rocky Linux 9.5
Current GitLab-Runner version: 18.1.3 ; OS: Ubuntu 20.04
Please note GitLab server and GitLab-Runner is on different servers.
I wanted to upgrade my production GitLab server from 18.1.3 to 18.7.1. I assume that the upgrade path would be 18.1.3 > 18.2.8 > 18.5.5 > 18.7.1. In that case, how should I upgrade the GitLab runner?
Should I upgrade GitLab runner first to 18.2.8 and then upgrade Gitlab to 18.2.8? Then continue to rest of the upgrade using the same method.
Or should I upgrade GitLab to 18.2.8 and then upgrade Gitlab runner to 18.2.8 and follow the method?
Or should I upgrade Gitlab to all the way to 18.7.1 (maintaining the upgrade path) and then upgrade the runner from 18.1.3 to 18.7.1 straight?
The gitlab-runner can be upgraded to the latest immediately. However generally you would upgrade the runner after Gitlab has been upgraded. So basically what you wrote in point 3.
Therefore, if you upgraded Gitlab all the way to 18.7.1 then you upgrade the runner to the latest available and that is it.
If you won’t be doing all the upgrades in a single sitting, eg: you will do only some upgrades today, and maybe the remainder in a few days or weeks, then whichever version you stop on, you could upgrade the runner to the corresponding version. So let’s say you upgraded to 18.5.5 and stopped, you then upgrade your runner to an 18.5.x version. Then in a few days or weeks, once you finish upgrading to 18.7.1 you can then upgrade the runner to the same version at this time.
General rule of thumb is that the runner should always be in sync with the version of Gitlab that it’s connected to.
Gitlab has an upgrade path because it has database migrations that run and need to be completed before attempting to upgrade to the next version. The gitlab runner doesn’t have to follow an upgrade path because it is just a runner, nothing more and so can be upgraded from the oldest to the latest version. However, as mentioned above, it does need to be in sync with the version of Gitlab.
We generally don’t keep the versions of GitLab and gitlab-runner in sync (GitLab is generally close to the latest, the runner is just “not very old” - and we know that’s contrary to the general advice) and that works fine. So any of your options would probably work, but unless you have a good reason, stick to the general advice, and upgrade the runner right after upgrading GitLab.