Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows & Linux living together in Kubernetes cluster

I was looking at the kubernetes documentation which seems to have a windows compability, however I don't find completely clear if both Linux and Windows can live together (I mean, in diferent VMs but the same cluster).

I would like to know if there is any support for this scenario in gcloud, azure or aws. And also, the procedure or example to make it work. Like how to create a pod in the correct VM (windows or linux) and how horizontal and cluster autoscalers work.

The use case is 2 APIs, one running in windows (.NET Framework) and other in linux (python/c++) and I want to be able to reroute them, be able to call each other, scale them and so on with kubernetes. As a note, the .NET Framework application have dependencies (mainly for mathematical optimization) that cannot be passed to .NET Core, this implies that I cannot convert the application to linux-based.

like image 503
silgon Avatar asked Sep 06 '18 07:09

silgon


People also ask

What do you mean by Windows?

A window is a separate viewing area on a computer display screen in a system that allows multiple viewing areas as part of a graphical user interface ( GUI ). Windows are managed by a windows manager as part of a windowing system .

Is Windows 10 free right now?

Upgrade from a Prior Windows Version: FreeIf you are still on Windows 7 or 8, you can upgrade to Windows 10 for free. Whether you're going from 7 / 8 to 10 or 10 to 11, you can upgrade either by using an install disk (created with the media creation tool) or with Windows update.

Will it be Windows 12?

Based on the new update roadmap, Windows will move to a 3-year release cycle. Since Windows 11 was released in 2021 (5th October, to be specific), it means Windows 12 should launch sometime in 2024, most probably in the fall, just like Windows 11.

Is Microsoft Windows for free?

Microsoft allows anyone to download Windows 10 for free and install it without a product key. It'll keep working for the foreseeable future, with only a few small cosmetic restrictions. And you can even pay to upgrade to a licensed copy of Windows 10 after you install it.


1 Answers

Some history, so containers is a Linux thing so there are no containers per se on Windows. Docker created Docker for Windows but essentially what it does is run a Hyper-V Linux VM (used to be VirtualBox) and inside it runs your containers. As of the latest Docker version, Microsoft has added capabilities on Hyper-V to allow running these containers kinda natively making it easy to run .NET apps in containers.

K8s is implemented in Golang so it was generally easier to port main components like the kubelet, kube-proxy, kubectl to Windows, by using the Golang cross-compiler (or native on Windows)

A tricky part is the networking but looks like they've got it figured out in the docs

As far as public cloud support from major providers:

  • AWS

    • Hypervisor: Modified Xen or KVM. No nested virtualization support.
    • VMs: Windows VMs. Can't take advantage of Hyper-V with nested virtualization, but can run Docker for Windows.
    • Bare-metal: (i3.metal as of this writing). Run Hyper-V natively and Docker for Windows.
  • Azure

    • Hypervisor: Hyper-V. Supports nested virtualization on some instance types.
    • VMs: Windows VMs, can use nested virtualization with Hyper-V, and can run Docker for Windows.
    • ACS, AKS, ACE: Should be able to take advantage of Hyper-V with nested virtualization and some cases natively.
  • GCP

    • Hypervisor: KVM. Supports nested virtualization on some instance types.
    • VMs: Windows VMs. Can run Hyper-V with nested virtualization and can run Docker for Windows.

Other than that I don't know what else there's to it (Other than what's in the docs) The question is very broad. Just install Docker for Windows, setup networking, join your cluster with kubeadm and schedule your Windows workloads using the nodeSelector spec in your pods and make sure you label your Windows nodes with beta.kubernetes.io/os=windows

There's another good guide on to set up Kubernetes with Windows nodes here

like image 70
Rico Avatar answered Oct 03 '22 18:10

Rico