วิธีทำ Windows Node บน Kubernetes

เมื่อองค์กรเริ่มนำ Kubernetes มาใช้งาน หนึ่งในคำถามที่พบบ่อยคือสามารถนำ Windows Server เข้ามาเป็น Worker Node ได้หรือไม่ คำตอบคือ “ได้” และปัจจุบันหลายองค์กรระดับ Enterprise กำลังใช้งาน Windows Node เพื่อรองรับ Application ที่พัฒนาด้วย .NET Framework, IIS และ Windows Service

Windows Node ช่วยให้องค์กรสามารถนำระบบเดิมเข้าสู่ Container Platform ได้โดยไม่ต้อง Rewrite Application ใหม่ทั้งหมด ทำให้การเปลี่ยนผ่านสู่ Cloud Native Infrastructure เป็นไปได้รวดเร็วยิ่งขึ้น

① Windows Node คืออะไร

Windows Node คือ Worker Node ที่ใช้

  • Windows Server 2025
  • Windows Server 2022

ทำหน้าที่รัน

  • Windows Container
  • IIS Application
  • ASP.NET Application
  • Enterprise Application

ภายใน Kubernetes Cluster

② Kubernetes Architecture ที่ถูกต้อง

โครงสร้างมาตรฐานคือ

Control Plane

Linux Node

Windows Node

Kubernetes ยังใช้ Linux สำหรับ Control Plane เป็นหลัก

ส่วน Windows จะทำหน้าที่ Worker Node เท่านั้น

③ ความต้องการขั้นต่ำ

Windows Node ควรมี

  • Windows Server 2025
  • Container Feature
  • Kubernetes Compatible Runtime
  • Network Connectivity
  • DNS Resolution

พร้อมเชื่อมต่อกับ Cluster ได้อย่างสมบูรณ์

④ ติดตั้ง Container Feature

ก่อนเข้าร่วม Cluster

ต้องเปิดใช้งาน

  • Containers
  • Hyper-V (กรณีใช้บาง Workload)

เพื่อรองรับการทำงานของ Windows Container

⑤ เลือก Container Runtime

ปัจจุบัน Kubernetes ใช้งาน

Containerd

เป็นหลัก

เนื่องจาก Docker Shim ถูกยกเลิกไปแล้ว

องค์กรใหม่ควรใช้ Containerd เป็นมาตรฐาน

⑥ Join Windows Node เข้าสู่ Cluster

หลังติดตั้ง Runtime แล้ว

สามารถ Join Cluster ได้

โดยใช้ Token จาก Kubernetes Control Plane

เมื่อเสร็จแล้ว Node จะปรากฏใน Cluster ทันที

⑦ ตรวจสอบ Node Status

หลัง Join สำเร็จ

ควรตรวจสอบ

  • Ready Status
  • Network Status
  • Runtime Status
  • DNS Resolution

เพื่อให้มั่นใจว่าระบบพร้อมใช้งาน

⑧ Label และ Taint

Windows Node ควรแยกจาก Linux Node

ตัวอย่าง

  • os=windows
  • workload=windows

ช่วยให้ Kubernetes Scheduler ส่ง Workload ไปยัง Node ที่ถูกต้อง

⑨ Deploy Windows Container

Application ที่รองรับ

  • IIS
  • ASP.NET
  • .NET Framework
  • Windows Service

สามารถ Deploy เป็น Container ได้

โดยใช้ Windows Base Image

⑩ Networking บน Windows Node

Networking เป็นส่วนที่ซับซ้อนที่สุด

ควรวางแผน

  • Pod Network
  • Service Network
  • DNS
  • Ingress

ให้เหมาะสมกับ Architecture ของ Cluster

⑪ Storage สำหรับ Windows Node

ควรเตรียม

  • Persistent Volume
  • Shared Storage
  • Backup Strategy

รองรับ Application ที่ต้องเก็บข้อมูลถาวร

⑫ Security ของ Windows Node

แนวทางที่แนะนำ

  • RBAC
  • Network Policy
  • Image Scanning
  • Patch Management
  • Vulnerability Assessment

เพื่อให้ Node มีความปลอดภัยสูงสุด

⑬ Monitoring Windows Node

สิ่งที่ควรติดตาม

  • CPU Usage
  • Memory Usage
  • Storage Usage
  • Container Health
  • Event Log

เพื่อป้องกันปัญหาก่อนกระทบ Production

⑭ ปัญหาที่พบบ่อย

หลายองค์กรพบปัญหา

  • Image Version ไม่ตรงกัน
  • DNS Error
  • Network Policy Conflict
  • Runtime Configuration ผิด

จึงควรมี Environment สำหรับทดสอบก่อนเสมอ

⑮ แนวทางที่องค์กรใหญ่ใช้

Production Cluster

Linux Node

Windows Node

Container Platform

Monitoring

Backup

Security

รูปแบบนี้เป็นมาตรฐานขององค์กรขนาดใหญ่จำนวนมาก

⑯ Windows Node เหมาะกับใคร

เหมาะสำหรับองค์กรที่มี

  • IIS
  • ASP.NET
  • .NET Framework
  • Legacy Windows Application

และต้องการเข้าสู่โลก Kubernetes โดยไม่ต้อง Rewrite ระบบทั้งหมด

สรุป

Windows Node เป็นส่วนสำคัญของ Kubernetes ในองค์กรที่ยังมี Application บน Windows จำนวนมาก ช่วยให้สามารถนำระบบเดิมเข้าสู่ Container Platform ได้อย่างรวดเร็ว ลดต้นทุนการพัฒนาใหม่ และรองรับการขยายระบบแบบ Cloud Native ได้ในอนาคต

comsiam มองว่า Windows Node เหมาะอย่างยิ่งสำหรับองค์กรที่กำลังเปลี่ยนผ่านจาก Traditional Infrastructure ไปสู่ Modern Platform โดยไม่ต้องทิ้งระบบเดิมที่ยังใช้งานได้ดี

comsiam ยังแนะนำให้แยก Linux Node และ Windows Node อย่างชัดเจน พร้อมกำหนด Label, Security Policy และ Monitoring ตั้งแต่วันแรก เพื่อให้ Cluster มีความเสถียรและรองรับการเติบโตในระยะยาว