Cluster Autoscaler - การขยายจำนวน Node

การใช้ cluster autoscaler นั้นอาจใช้ร่วมกับ horizontal cluster autoscaler (HPA) เพื่อรองรับความต้องการ resource ที่เพิ่มมากขึ้นจาก pod ที่ถูก scale จาก HPA โดย cluster autoscaler จะทำหน้าที่ scale จำนวน node ภายใน cluster ให้เพียงพอเมื่อเกิดเหตุการณ์ที่ pod ไม่สามารถ schedule ลง node ใดๆได้

วิธีการ enable cluster autoscaler ให้กับ cluster ที่ต้องการนั้น สามารถทำได้ตามตัวอย่างด้านล่างนี้

apiVersion: provisioning.cattle.io/v1
kind: Cluster
spec:
  rkeConfig:
    machinePools:
    - name: worker-pool-a
      quantity: 5
      workerRole: true
      machineDeploymentAnnotations:
        cluster.provisioning.cattle.io/autoscaler-min-size: "5"
        cluster.provisioning.cattle.io/autoscaler-max-size: "20"

จากตัวอย่างด้านบนมีการ config cluster autoscaler ไว้ว่าหาก cluster underutilization ให้ scale down ลงมาโดยจะไม่ต่ำกว่า 5 nodes และเมื่อ cluster overutilization ให้ scale out ขึ้นไปโดยจะไม่สูงกว่า 20 nodes

Last updated

Was this helpful?