Skip to content

Kuberntes executor unsupported Windows Version error for Windows Server 2022

Summary

After setting up GitLab runner in a kubernetes cluster with windows nodes running Windows Server 2022, jobs fail with the following message:

ERROR: Preparation failed: prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348

This works fine when using the docker-windows executor.

Zendesk Ticket: https://gitlab.zendesk.com/agent/tickets/362592 (internal)

Steps to reproduce

  1. Deploy a kubernetes cluster with windows nodes running Windows Server 2022 (in my example, I used EKS)

Actual behavior

Job fails with the following error: ERROR: Job failed (system failure): prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348

Expected behavior

Job should run successfully

Relevant logs and/or screenshots

Job Log
Running with gitlab-runner 15.7.0 (259d2fd4)
  on gitlab-runner-8cb84bf58-66gqj hXsiYmyy
  feature flags: FF_USE_POWERSHELL_PATH_RESOLVER:true
Resolving secrets
00:00
Preparing the "kubernetes" executor
00:09
Using Kubernetes namespace: gl-runner
ERROR: Preparation failed: prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348
Will be retried in 3s ...
Using Kubernetes namespace: gl-runner
ERROR: Preparation failed: prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348
Will be retried in 3s ...
Using Kubernetes namespace: gl-runner
ERROR: Preparation failed: prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348
Will be retried in 3s ...
ERROR: Job failed (system failure): prepare helper image: detecting base image: unsupported Windows Version: 10.0.20348

Environment description

Values.yaml
imagePullPolicy: IfNotPresent
gitlabUrl: "xxxxx"
runnerRegistrationToken: "xxxx"
nodeSelector:
  kubernetes.io/os: linux

rbac:
  create: true

securityContext:
  runAsUser: 100

runners:
  config: |
    [[runners]]
      name = "gl-cmutua-windows"
      environment = [ "FF_USE_POWERSHELL_PATH_RESOLVER=1" ]
      executor = "kubernetes"
      [runners.kubernetes]
        namespace = "{{.Release.Namespace}}"
        image = "mcr.microsoft.com/windows/servercore:ltsc2022"
        privileged = false
        pull_policy = "if-not-present"
        shell = "powershell"
      [runners.kubernetes.pod_security_context]
      [runners.kubernetes.node_selector]
        "kubernetes.io/arch" = "amd64"
        "kubernetes.io/os" = "windows"
        "node.kubernetes.io/windows-build" = "10.0.20348"
  tags: windows

Used GitLab Runner version

Possible fixes

Edited by Christopher Mutua