0

Both host and container cmd /c ver return 10.0.20348.230 but still Kubernetes complains that The container operating system does not match the host operating system. Any ideas?

apiVersion: v1
kind: Pod
metadata:
  name: aspnet-test
spec:
  containers:
  - image: mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2022
    name: aspnet-test
    ports:
    - containerPort: 80
      name: http
      protocol: TCP
  nodeSelector:
    kubernetes.io/os: windows

docker run -it -p 5000:80 mcr.microsoft.com/dotnet/framework/aspnet:4.8-windowsservercore-ltsc2022 works. The image was downloaded by this command, so Kubernetes decided about the error before fetching it.

Retested with Microk8s and Kubernetes 1.22.3.

Jan Zahradník
  • 2,417
  • 2
  • 33
  • 44
  • Can you please add more details to your question? How was it set up? Does 1.21 version works? What exactly you tried to run? Please provide a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – moonkotte Oct 12 '21 at 15:07
  • Setting a new cluster with 1.21 would be too much effort, as well as a minimal example. Just preparing a single Windows node takes few hours. I've tried with LTSC 2019 and it starts. Unfortunatelly there are no published ports in `docker port` for the container. Next step... next error. Realy are Windows workers such a niche thing? – Jan Zahradník Oct 12 '21 at 19:19
  • What image are you running? Is it something custom built or ready one so I can test it as well? Also just to make it clear, this pod is getting scheduled on the described node with server 2022? Unfortunately there's no [much information about such issues](https://learn.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility?tabs=windows-server-20H2%2Cwindows-10-20H2#matching-versions-using-kubernetes) – moonkotte Oct 14 '21 at 15:27

0 Answers0