Generate system id when installing GitLab Runner through the Helm Chart

What does this MR do?

GitLab Kubernetes integration - runner receives a new ID every time cluster is restarted leading to clutter in list of runners. That ends up with a long list of the same GitLab Runner in the Runner List UI.

With this MR, the system_id/.runner_system_id is automatically generated using .Release.Name and .Release.Namespace.

The methodology used for the generated is explained in the following thread #455 (comment 1384860830)

Why was this MR needed?

Avoid the long list of the same GitLab Runner in the UI

What's the best way to test this MR?

  • Use the MR branch

.runner_system_id on default

  • Run the command to install GitLab Runner
helm install gitlab-runner . -f PATH_TO_YOUR_VALUES_YAML
  • ssh to the GitLab Runner Manager Pod
  • Run the following command
cat /home/gitlab-runner/.gitlab-runner/.runner_system_id
  • Note the id generated
  • Uninstall GitLab Runner
helm delete gitlab-runner
  • Restart from the beginning. Both system_id (content of the .runner_system_id) should be the same

.runner_system_id on different namespace

  • Create a new namespace and install GitLab Runner
kubectl create ns gitlab-runner
helm install gitlab-runner . -f PATH_TO_YOUR_VALUES_YAML --namespace gitlab-runner 
  • ssh to the GitLab Runner Manager Pod
  • Run the following command
cat /home/gitlab-runner/.gitlab-runner/.runner_system_id
  • Note the id generated
  • Uninstall GitLab Runner
helm delete gitlab-runner --namespace gitlab-runner
  • Restart from the beginning. Both system_id (content of the .runner_system_id) should be the same
  • Delete the gitlab-runner namespace
kubectl delete ns gitlab-runner

What are the relevant issue numbers?

close #455

Merge request reports

Loading