Problems running windows worker node in kubernetes cluster - mismatched operating system?

0

I'm trying to get a windows (server 2019) based docker container running inside a kubernetes cluster, using the mcr.microsoft.com/windows/servercore:1809 image from here

When deploying the container, I'm getting an error that suggests:

The container operating system does not match the host operating system

Having double checked the operating system in both container and host node (which is a windows server 2019 datacenter system), both show the same:

Microsoft Windows [Version 10.0.17763.437]

The docker container runs ok when run directly on the host system (not within the kubernetes cluster)

Any ideas what's going wrong?

Detail from describe pod below.


user@k8s-mstr:~/kube_projects/testdemo-4.1/app$ kubectl -n test describe pod test-7b8d99f8f9-ksnnp
Name:               test-7b8d99f8f9-ksnnp
Namespace:          test
Priority:           0
PriorityClassName:  <none>
Node:               wins2019-worker/192.168.1.10
Start Time:         Wed, 17 Apr 2019 11:50:00 +0100
Labels:             io.kompose.service=test
                    pod-template-hash=7b8d99f8f9
Annotations:        <none>
Status:             Pending
IP:
Controlled By:      ReplicaSet/test-7b8d99f8f9
Containers:
  test:
    Container ID:
    Image:         test:wins19.4.2.1
    Image ID:
    Port:          8075/TCP
    Host Port:     0/TCP
    Args:
      python
      hello.py
    State:          Waiting
      Reason:       ContainerCreating
    Ready:          False
    Restart Count:  0
    Environment:    <none>
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-xtwkj (ro)
Conditions:
  Type              Status
  Initialized       True
  Ready             False
  ContainersReady   False
  PodScheduled      True
Volumes:
  default-token-xtwkj:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-xtwkj
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  kubernetes.io/os=windows
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age                  From                      Message

------

  Warning  FailedScheduling        63s (x5 over 4m12s)  default-scheduler         0/3 nodes are available: 1 node(s) had taints that the pod didn't tolerate, 2 node(s) didn't match node selector.
  Normal   Scheduled               61s                  default-scheduler         Successfully assigned test/test-7b8d99f8f9-ksnnp to wins2019-worker
  Warning  FailedCreatePodSandBox  56s                  kubelet, wins2019-worker  Failed create pod sandbox: rpc error: code = Unknown desc = failed to start sandbox container for pod "test-7b8d99f8f9-ksnnp": Error response from daemon: CreateComputeSystem 4e42952b56de687e7c784aa1b72e8f2079ec945fdbea6f5dbe173c7acf1e8fc8: The container operating system does not match the host operating system.
(extra info: {"SystemType":"Container","Name":"4e42952b56de687e7c784aa1b72e8f2079ec945fdbea6f5dbe173c7acf1e8fc8","Owner":"docker","VolumePath":"\\\\?\\Volume{668e77e8-1d2d-46e7-84c1-364be7ad7d68}","IgnoreFlushesDuringBoot":true,"LayerFolderPath":"C:\\ProgramData\\docker\\windowsfilter\\4e42952b56de687e7c784aa1b72e8f2079ec945fdbea6f5dbe173c7acf1e8fc8","Layers":[{"ID":"7f4bd9df-f1ea-5927-bd98-14abd0c7140c","Path":"C:\\ProgramData\\docker\\windowsfilter\\6c6b5d97817dbf136d7ec79febda2a3f3397d855fe7d1e933b23728af95b6a0b"},{"ID":"f87834c9-c212-535a-b960-95f16ca44177","Path":"C:\\ProgramData\\docker\\windowsfilter\\edd108b444a8be7be8d412a85c762633094daf6c2e97f51e023cab8508cf2a76"},{"ID":"6a0b1067-e6a2-5532-b748-ad376af5862c","Path":"C:\\ProgramData\\docker\\windowsfilter\\25a5e85c88cd9d6394752b3d8d6235a3e4a502b2b3864665c16f2a14fab50215"}],"ProcessorWeight":2,"HostName":"test-7b8d99f8f9-ksnnp","HvPartition":false})

tmn103

Posted 2019-04-17T11:22:59.027

Reputation: 1

Answers

0

I had missed a key stage in this and hadn't tagged microsoft/nanoserver:1809 as microsoft/nanoserver:latest

Addressed this, then re-ran .\start.ps1 so that kubeletwin/pause image was rebuilt from correct image.

and then the pod started running without errors

tmn103

Posted 2019-04-17T11:22:59.027

Reputation: 1