kubernetes: kubelet on Windows fails if a pod has SecurityContext with RunAsUser.

What happened?

Install a cluster with v1.29.4 with linux node as master and worker node as windows kubeadm upgrade apply v1.30.0 fails with

[ERROR CreateJob]: Job \"upgrade-health-check-4rxpv\" in the namespace \"kube-system\" did not complete in 15s: no condition of type Complete [preflight] If you know what you are doing, you can make a check non-fatal with –ignore-preflight-errors`

Describe Pod events:

mountvolume.setup failed for volume "kube-api-access-rncjh" : chown c:\var\lib\kubelet\pods\c5a3db55-4ee9-4b99-8fd6-17da5799f34a\volumes\kubernetes.io~projected\kube-api-access-rncjh\..2024_05_08_20_28_34.3908400707\token: not supported by windows

It seems that previously the pod was Pending as well, but this was ignored, because the jobs was successfully deleted in defer and return value was overridden with nil.

defer func() {
    lastError = deleteHealthCheckJob(client, ns, jobName)
}()

https://github.com/kubernetes/kubernetes/blob/v1.29.1/cmd/kubeadm/app/phases/upgrade/health.go#L151

What did you expect to happen?

Upgrade health check job expected to be scheduled only on Linux nodes using node selectors, rather than on Windows nodes.

How can we reproduce it (as minimally and precisely as possible)?

See What happened?

Anything else we need to know?

No response

Kubernetes version

kubeadm version (use kubeadm version): v1.30.0

Environment:

Kubernetes version (use kubectl version): v1.30.0 Cloud provider or hardware configuration: OS (e.g. from /etc/os-release): Ubuntu 22.04.2 LTS, Windows Server 2022 Datacenter Kernel (e.g. uname -a): 5.19.0-1025-aws Container networking plugin (CNI): calico

Cloud provider

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, …) and versions (if applicable)

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 21 (20 by maintainers)

Commits related to this issue

Most upvoted comments

@carlory pull-kubernetes-e2e-capz-windows-master is the e2e test job for Windows

@mani3196 slack discussion is happening here: https://kubernetes.slack.com/archives/C0SJ4AFB7/p1716283930327109 but we have agreed that this is a kubelet problem. on the kubeadm side you can use the --ignore-preflight-errors=CreateJob option to skip the check.

unclear when or if a kubelet fix will be added and to what versions it will be available.

/transfer kubernetes