Skip to content

Use exec mode to create the scripts in attach mode

Romuald Atchadé requested to merge k8s-replace-configmaps-in-attach-mode into main

What does this MR do?

In attach mode, we currently have an issue related to the size of the configMaps and another one related to some environment variables no being accurately updated. A SPIKE was tried to simply replace the configMaps by emptyDir but the problem was still present.

In this MR, we do the following to solve those issues:

  • Replace the configMaps by emptyDir
  • Use exec mode to create the script within the container. Except for the trapping scripts which are being created when preparing the pod, the stage script are created just before execution
  • Execute the scripts in attach mode

Why was this MR needed?

This MR is needed to:

  • Fix the limitation related to the 1MB limit for configMaps
  • Fix the problem related to the update of some environment variables

What's the best way to test this MR?

bash shell

config.toml
concurrent = 1
check_interval = 1
log_level = "error"

[session_server]
  session_timeout = 1800

[[runners]]
  url = "https://gitlab.com/"
  token = "__TOKEN__"
  executor = "kubernetes"
  [runners.kubernetes]
    image = "alpine:latest"
    terminationGracePeriodSeconds = 0
    [runners.kubernetes.dns_config]
    [runners.kubernetes.container_lifecycle]

pwsh shell

config.toml
concurrent = 1
check_interval = 1
log_level = "error"

[session_server]
  session_timeout = 1800

[[runners]]
  url = "https://gitlab.com/"
  token = "__TOKEN__"
  executor = "kubernetes"
  shell = "pwsh"
  [runners.kubernetes]
    image = "mcr.microsoft.com/powershell:7.1.1-alpine-3.12-20210125"
    terminationGracePeriodSeconds = 0
    [runners.kubernetes.dns_config]
    [runners.kubernetes.container_lifecycle]

powershell shell

config.toml
concurrent = 1
check_interval = 1
log_level = "error"

[session_server]
  session_timeout = 1800

[[runners]]
  url = "https://gitlab.com/"
  token = "__TOKEN__"
  executor = "kubernetes"
  [runners.kubernetes]
    image = "mcr.microsoft.com/windows/servercore:ltsc2019"
    helper_image = "gitlab/gitlab-runner-helper:x86_64-latest-servercore1809"
    poll_timeout = 3600
    [runners.kubernetes.node_selector]
      "kubernetes.io/arch" = "amd64"
      "kubernetes.io/os" = "windows"
      "node.kubernetes.io/windows-build" = "10.0.17763"
    [runners.kubernetes.dns_config]
    [runners.kubernetes.container_lifecycle]

What are the relevant issue numbers?

close #27693 (closed), #28036 (closed)

Edited by Romuald Atchadé

Merge request reports