Kubernetes (อ่านว่า "CUBE-A-NET-IS") เป็น open-source platform ช่วยจัดการ container applications อย่าง Docker ไม่ว่าจะ automate หรือ scale containers ข้าม multiple hosts Kubernetes เร่ง deployment ทำได้ด้วย internal components เช่น Kubernetes API หรือ third-party extensions ที่รันบน Kubernetes
บทความนี้ช่วยเข้าใจ basic concepts ของ Kubernetes และทำไมมันก่อให้เกิด seismic shift ใน server market vendors และ cloud providers อย่าง Azure และ Google Cloud เสนอ Kubernetes services
Kubernetes: ประวัติสั้น
Kubernetes เป็นหนึ่งใน gifts ของ Google ให้ open source community Container platform เป็นส่วนของ Borg internal Google project มากกว่าทศวรรษ Borg ให้ Google manage hundreds และ thousands of tasks (เรียก "Borglets") จาก applications ต่างๆ across clusters เป้าหมาย: utilize machines (และ VMs) efficiently พร้อม ensure high availability ของ run-time features
สถาปัตยกรรมเดียวกัน popular กับบริษัทอื่นๆ หาวิธี efficiently ensure high availability ที่ไหน 2015 Kubernetes 1.0 ออก Google สละ control over technology Kubernetes อยู่กับ foundation Cloud Native Computing Foundation (CNCF) ซึ่งเป็นส่วนของ Linux Foundation
Kubernetes ทำงานอย่างไร
ยืม ideas จาก Borg Project "Borglets" ให้ทาง "pods" ซึ่งเป็น scheduler units ที่บรรจุ containers โดยพื้นฐานมี individual IP addresses เข้ามาเมื่อ container ต้องการ CPU, memory หรือ storage
Pods ensure high availability โดย load balancing traffic ใน round-robin format เพิ่มเติม อยู่ใน machines (หรือ VMs) เรียก "worker nodes" หรือ "minions" จากจุดนี้ "master node" ควบคุม entire cluster โดย orchestrate containerization ใช้ Kubernetes API Docker รันได้ในแต่ละ worker node download images และ start containers
เพื่อ API connection ที่ Kubernetes cluster ใช้ CLI syntax เรียก kubectl คำสั่งสำคัญมาก เพราะ single-handedly รันคำสั่งทั้งหมดที่ Master node ส่งให้ worker nodes Mastering kubectl ต้องเรียนรู้นิดหน่อย แตเรียนรู้แล้ว ใช้ Kubernetes clusters ได้ Kubernetes และ Docker เขียนด้วย Go programming language
Applications
Kubernetes ลด server และ data center costs ดรามาติคเพราะ high efficiency using machines Common applications:
- Managing application servers ส่วนใหญ่ต้องการ security, configuration management, updates รันได้ด้วย Kubernetes
- Automatic rollouts และ rollbacks Kubernetes ไม่ต้องกังวล product rollouts/rollbacks across multiple end nodes
- Deploying stateless apps Web apps remotely controllable Kubernetes ช่วยรัน Nginx servers stateless deployment
- Deploying stateful apps Kubernetes รัน MySQL database ได้
- Storing API objects Storage needs ต่างๆ Kubernetes ensures ideal storage ใช้ container principles
- Out-of-the-box-ready Kubernetes helpful สำหรับ service discovery, logging, monitoring, authentication
- IoT applications Kubernetes ใช้เพิ่มใน IoT เพราะ massive scaling capability
- Run anywhere รัน Kubernetes ที่ไหนก็ได้ รวมถึงในกระเป๋าเดินทาง
สรุป
เป้าหมาย Kubernetes: utilize computing resources สูงสุด เนื่องจาก orchestrate containers ข้าม multiple hosts end nodes ไม่มี resource problems หรือ failure ช่วย scale automatically เพราะให้คำสั่งครั้งเดียวจาก Master node scale applications ไม่เหมือน革命
เรียนรู้ Kubernetes มากขึ้น เยี่ยม official website มี tutorials