Skip to content

Update documentation for pod_overwrite feature

What does this MR do?

Updates the documentation on configuring keywords in the gitlab-runner for kubernetes, specifically for pod_overwrite.

Why was this MR needed?

It was needed because the documentation wasn't too explicit. I and a colleague had issues configuring the pod_annotation_overwrite expression and I guess a couple others might too.

Are there points in the code the reviewer needs to double check?

I added a sample spec for other keywords at the top so people visiting know the configs can be updated from the deployment as opposed to the config.toml description at the bottom which was a bit misleading.

I had tried to update the config.toml spec in the ConfigMap but those got written and never applied.

This is because the toml spec gets duplicated with the config from environment variables which are written at the bottom of the file and takes precedence over the ConfigMap spec.

Sample spec below: configmap config.toml in k8s

listen_address = "[::]:9252"
concurrent = 10
check_interval = 30
log_level = "info"
[session_server]
  session_timeout = 1800
[[runners]]
  [runners.kubernetes]
    pod_annotations_overwrite_allowed = "*"
    [runners.kubernetes.pod_annotations]
      "<KEY>" = "<TRUNCATED>"
      "<KEY>" = "<TRUNCATED>"

config.toml file in GitLab Runner

listen_address = "[::]:9252"
concurrent = 10
check_interval = 30
log_level = "info"

[session_server]
  session_timeout = 1800

[[runners]]
  name = ""
  url = ""
  token = ""
  executor = ""
  [runners.kubernetes]
    host = ""
    bearer_token_overwrite_allowed = false
    image = ""
    namespace = ""
    namespace_overwrite_allowed = ""
    privileged = false
    service_account_overwrite_allowed = ""
    pod_annotations_overwrite_allowed = "*"
    [runners.kubernetes.pod_annotations]
      "<KEY>" = "<TRUNCATED>"
      "<KEY>" = "<TRUNCATED>"
    [runners.kubernetes.volumes]

[[runners]]
  name = "eks-lab-gitlab-runner-5f6bfb9b8f-xf6fl"
  request_concurrency = 1
  url = "<TRUNCATED>"
  token = "<TRUNCATED>"
  executor = "kubernetes"
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
  [runners.kubernetes]
    host = ""
    bearer_token_overwrite_allowed = false
    image = "<TRUNCATED>"
    namespace = "kube-system"
    namespace_overwrite_allowed = ""
    privileged = true
    service_account_overwrite_allowed = ""
    pod_annotations_overwrite_allowed = ""
    [runners.kubernetes.volumes]

Does this MR meet the acceptance criteria?

  • Documentation created/updated

What are the relevant issue numbers?

No issues but it builds on docs updates from other developers.

!1220 (merged) 4bf05c57

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading