Working with Windows Containers in Kubernetes

Even though Docker was built atop Linux containers and that is the majority of Docker usage out there, Windows Containers have been a thing for a while now. They went mainstream in 2016, and one hopes “ready for primetime” with Windows Server 2019. Even though integration with Docker is getting tighter, if you are in the unfortunate position of having to use Windows Containers with Kubernetes, you are going to have issues.

If your language/runtime is platform-independent, and if you’re not invoking any platform-specific libraries, your best bet would be to just stick to Linux containers. For .NET folks, this means using .NET Core and making sure you’re not using anything that is Windows-native (or if you are, making sure there is a fallback or abstraction or what-have-you). Additionally, you should make sure your code is not making any assumptions about what platform it is running on (think file path roots and separators). Staying with Linux containers means - if nothing else - that your Kubernetes deployment is part of the majority - and you are more likely to find resources or support online for issues that may arise.

If you do decide to embark on your Windows Container-Kubernetes journey, keep the following in mind:

Azure Kubernetes Service (AKS)

Assuming you are going with AKS, you have to then keep the following in mind:

All said though, as of today, it’s all experimental so you can’t really run production workloads. So if you’re on Windows and are considering Kubernetes, you can use the above to start preparing for your eventual migration, or alternatively if you have the option, you can start preparing your application so it can run on Linux.



Tags: kubernetes dotnetcore docker containers microservices azure aks
Previous: Installing PFX Certificates in Docker Containers
Next: Revisiting Kubernetes vs. Service Fabric

Comments

comments powered by Disqus