[Jenkins] Controller and Agents Architecture

Jenkins Controller and Agents Architecture

  • ถ้าใครไปอ่าน doc เก่าๆ Controller (Master) และ Agent (Slave)นะครับ
  • แนวคิดของ Controller and Agents Architecture จะการ CI/CD ที่มีการ Scale-Out เพิ่มจำนวน Node ในที่นี้ Node คือ ตัว Jenkins เพื่อมารองรับกระจาย(Distributed) งานด้าน CI/CD ที่เพิ่มมากขึ้น จากความต้องการ Functional / Time to Market / Quality ยกตัวอย่าง เช่น การ Build และ Execute Unit Test เมื่อมีการ Commit & Push เข้ามาในแต่ละ Branch ครับ ยิ่งถ้ามีหลาย Branch ตัว Jenkins ภาระงานเพิ่มขึ้น
  • ใน Jenkins
    • Controller - ตัวกระจายงาน
    • Agents / Node - ตัวที่ทำงาน ตามชิ้นงานที่ Controller ส่งมาครับ
  • การสื่อสารระหว่าง Controller กับ Agents / Node
    • หลักใช้วิธี SSH ครับ ตัว Controller จะส่ง remote.jar ไปยัง Agents ต่างๆ เพื่อสั่ง Jenkins ของเครื่องปลายทางอีกที
    • แต่ในหลาย Platform มีวิธีพิเศษเพิ่มขึ้นมา เช่น Windows สามารถ WMI Command เข้าไปจัดการแทนได้ครับ

Controller (Master) คือ อะไร ?

  • Jenkins ที่เป็นสมอง และศูนย์รวมของ Job ต่างๆ (Single Command Center)
  • หน้าที่
    • จัดการ Agents ต่างๆ
    • กระจายงานส่งให้ Agents ทำงาน
    • ตัว Monitor งาน/สถานะของ Agents

Agents (Slave) คือ อะไร ?

  • Jenkins ที่ Execute Job ผ่านทาง remote.jar หรือ agent.jar และอย่าลืมด้วยว่า Jenkins ที่เป็น Controller มันสามารถที่หน้าที่ Agents / Node ได้เหมือนกัน ถ้ามี Slot (Executor) เหลือ
  • หน้าที่ - ทำงาน ตามชิ้นงานที่ Controller ส่งมาครับ

หลังจาก Intro ไปและ Blog ตอนต่อไปมาลอง Setup Controller and Agents Architecture กันครับ

Reference


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts to your email.