Moving ASP.NET to Kubernetes on MacOS

2/2/2022

My team is working on an ancient monolithic project written in ASP.NET; to add to the fun, the project only works on IE11 (out of service life) which is only available on PC. We're trying to modernize the application by moving to containers in Kubernetes (and yes, we will eventually dismantle it but not for a while). While we have a dev environment setup, we also need to build a QA and eventually Prod environment. We're working on MacOS and can't see the container built in VMWare Fusion and have no idea why.

The project uses:

-ASP.Net MVC 1.0

-.Net Framework v4.8

-XmlTransformed web.config

-Windows Authentication

Cannot get it to run locally, but builds just fine. Has a health monitor that fails if there is a configuration error. This prevents the container from coming up in k8s to be inspected. Build/deploy times ~30min per cycle.

Options we're actively exploring: 1) Get a VM running Windows with IE11: Not sure what level of access we'll have and whether it is sufficient to debug using VisualStudio or other. We need admin access but unsure whether IAM/AD policies will get in the way. 2) Get a physical PC shipped to our lead developers house: He'll definitely have admin access but this seems like the nuclear option.

Thoughts? Looking for any advice on this.

-- pandamaru
asp.net
kubernetes
macos

3 Answers

2/2/2022

Adding to Tim's answer:

There are Linux containers and Windows containers. Since .NETFramework 4.8 is Windows only, you’ll need to be able to run Windows containers on Kubernetes. Windows containers can only run on a Windows host, See this answer for more details, so you'll need a Windows nodepool in your kubernetes cluster. Then you can set a node selector for Windows nodeSelector: { kubernetes.io/os: windows }

To build/run Windows Containers on OSX, you'll need to run a Windows VM. See this for example: https://github.com/StefanScherer/windows-docker-machine#create-the-docker-machine

-- ahmelsayed
Source: StackOverflow

2/2/2022

Presumably you would have to run this in a Windows container. On mac you would have to either dual boot it or use a VM in order to run windows containers, and if you are going to do that you may as just install it in a VM without getting docker and k8s involved.

Highly likely you can get it up and going in a VM, auth and networking will be your sticking points, but probably solvable, I doubt that you will need to ship a physical machine to your lead dev. (it's also likely you can host the VM in Azure / AWS or Google Cloud - if you want to)

-- Tim Jarvis
Source: StackOverflow

2/2/2022

Adding to both Tim and Ahmed's answers:

Please verify that in VMWare Fusion the backend being used for Docker Desktop (I assume you are using) is a Windows container. Docker Desktop on Windows has access to 2 backends Windows and WSL2 (Linux).

You also still might run into some issues with nested virtualization scenarios if it's not configured properly as mentioned in Docker's Documentation.

You can verify what architecture you are running by doing a docker version command. You could also help the troubleshooting by posting your Docker build log that should point out which architecture is being used to construct the image.

-- Peter
Source: StackOverflow