How to deploy Kubernetes pods across Windows OS versions with Hyper V on Windows 1803?

10/26/2018

I have a simple one master (Ubuntu 1604), one worker (Windows Server 1803) kubernetes cluster.

I also have a Jenkins build agent (Windows Server 2016) that builds a .NET docker image in a pipeline.

Base Image: FROM microsoft/aspnet:4.7.2-windowsservercore-ltsc2016

My goal is to create a deployment on the kubernetes worker (Windows Server 1803) using the image that the Jenkins build agent (Windows Server 2016) built. However, since Windows Images must match the exact Windows version they are running on, this cannot currently be done out of the box.

From https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility

"Windows Server Containers are blocked from starting when the build number between the container host and the container image are different"

However, from that same link (https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility) it describes that this is possible using Hyper-V.

Unlike standard Windows containers, which share the kernel between containers and the host, each Hyper-V isolated container has its own instance of the Windows kernel. Because of this you can have different OS versions in the container host and image (see compatibility matrix below).

I used docs from here: https://docs.microsoft.com/en-us/windows-server/virtualization/hyper-v/get-started/install-the-hyper-v-role-on-windows-server, and ran the following and restarted the Windows host to try to enable Hyper-V:

Install-WindowsFeature -Name Hyper-V -ComputerName <computer_name> - 
IncludeManagementTools -Restart

Then, again from https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility,

To run a container with Hyper-V isolation, simply add the tag --isolation=hyperv to your docker run command.

I attempted this by RDPing onto the 1803 worker and running the following docker command, and got same error. (Container OS has to match Host OS)

docker run microsoft/iis:ltsc2016 --isolation=hyperv

Overall, I was not able to run a docker container with hyperv, and I can't seem to find anything on how to "activate" or use hyperv with a kubernetes deployment yml file either.

Any thoughts are vastly appreciated!

More details:

Cluster Set up using: https://onedrive.live.com/view.aspx?resid=E2B6765015E5FA01!339&ithint=file%2cdocx&app=Word&authkey=!AGvs_s_hWs7xHGs

Above link was an updated set of instructions on the feedback section of this page: https://docs.microsoft.com/en-us/virtualization/windowscontainers/kubernetes/getting-started-kubernetes-windows, which did not work for me.

-- mm1620
docker
hyper-v
kubernetes
windows
windows-server

0 Answers