Kubernetes on Windows & Linux
Kubernetes was originally Linux-only, but now supports Windows worker nodes, enabling hybrid clusters.Why Windows Containers?
- Legacy Apps: Lift-and-shift .NET Framework applications.
- Unified Management: Manage Windows and Linux apps with the same tool (Kubernetes).
- Modernization: Slowly refactor monoliths into microservices.
Architecture: Hybrid Cluster
A Kubernetes cluster can contain both Linux and Windows nodes.- Control Plane: MUST run on Linux.
- Worker Nodes: Can be Linux or Windows.
Scheduling Workloads
You must ensure Windows Pods land on Windows Nodes and Linux Pods land on Linux Nodes.Using nodeSelector
Using Taints and Tolerations
To prevent Linux pods from accidentally landing on Windows nodes (and vice-versa).-
Taint the Windows Node:
-
Add Toleration to Windows Pod:
Key Differences & Limitations
| Feature | Linux | Windows |
|---|---|---|
| Container Base Image | Small (Alpine ~5MB) | Large (Server Core ~3GB) |
| Startup Time | Seconds | Seconds to Minutes |
| Networking | Bridge, Overlay | Host Networking not supported |
| Privileged Containers | Supported | Not Supported |
| Filesystem | Case-sensitive | Case-insensitive |
| Active Directory | Via LDAP/Kerberos | GMSA (Group Managed Service Accounts) |
Best Practices
Use Taints and Tolerations
Use Taints and Tolerations
Always taint Windows nodes to prevent Linux pods (like DaemonSets) from failing to start on them.
Image Management
Image Management
Windows images are large. Use a local registry or caching to speed up pulls. Match the container OS version with the host OS version (Process Isolation).
GMSA for Auth
GMSA for Auth
Use Group Managed Service Accounts (GMSA) for Windows pods that need to authenticate with Active Directory.
🎉 Congratulations! You’ve completed the Kubernetes Crash Course and the entire DevOps Tools Mastery course! Next: Back to Overview →