From where does one update the config.toml of a Kubernetes executor?

Hi all,

Seen a few of these questions around, as of yet unanswered.

From where does one edit the config.toml of a Kubernetes executor pod?

Obviously, getting onto the pod itself and editing /home/gitlab-runner/.gitlab-runner/config.toml is not going to persist a container restart.

Like a few others, I am moving from docker to buildah, and it is required to add:

[[runners.kubernetes.volumes.host_path]]
name = “buildah”
mount_path = “/var/lib/containers/”
read_only = false

EDIT: Only the “stub” config.toml is available in the ConfigMap of runner-gitlab-runner.

Now, i’ve seen some advice about updating the runner via a Helm chart, but cannot find anything concrete.

Any assistance would be highly appreciated.

Cheers

I have been wondering about the same thing. The docs are very confusing when it comes to this. In the docs, the parts referring to the config.toml seem like they’re talking about using an executor that’s not inside the kubernetes clunter. I’m using Helm to install the executor and in that case, as far as I understand, values.yaml is used to configure the runner.

So the answer is: you won’t have a config.toml when you use Helm to install the executor in the Kubernetes cluster

I had a similar problem in which I had to add a volume. The problem is that the register command appends the full runner section.
I manipulated the config map generated by the helm in order to add a template config file as described in the following example - https://docs.gitlab.com/runner/register/#example and then restarted the pod.

Steps:

  1. Add another file to the configmap that contains the template
  2. on the entrypoint section of the config map before running the registration add:
    export TEMPLATE_CONFIG_FILE=–template-config=/scripts/template_config.toml
  3. replace the config map
  4. restart the pod

I would suggest to add a template config section to the helm values file and add it to the config map + define the relevant environment variable to the pod.

Don’t mean to revive an older thread, but this question seems to remain valid. I’m in need of adding a volume to runners and while the documentation for doing so via config.toml is quite complete, it’s unclear how to add this when using the helm chart for starting the gitlab-ci-runner instance itself.

1 Like