# Create Load Balancer

## Prerequisite

* มียอดคงเหลือใน Project มากกว่า 0 บาท ([ขั้นตอนการเติมเงินเข้าสู่ Project](/ncs-documents/nipa-cloud-space-overview/billing-and-wallet/topup-a-project-wallet.md))

## Instructions

### 1. เข้าสู่ Project

กดเลือก project จากหน้า ยrojects Management เพื่อเข้าสู่หน้า Project Detail

<figure><img src="/files/vuA3uh2cjbSx91c7V54b" alt=""><figcaption><p>Project Detail</p></figcaption></figure>

### 2. เลือกคำสั่ง Create Load Balancer

เข้าสู่หน้า Load Balancer โดยกด menu Load Balancing - Load Balancer ภายใต้ sidebar และกดปุ่ม Load Balanacer ที่มุมขวาบนของหน้า Load Balancer

<figure><img src="/files/e9PH0HD28kTBs3EoxHQO" alt=""><figcaption><p>Load Balancer Create Button</p></figcaption></figure>

### 3. เลือก Availability Zone, กำหนดชื่อและคำอธิบายเพิ่มเติม ของ Load Balancer

ใน step แรก step Detail ให้เลือก Availability Zone, กำหนดชื่อและคำอธิบายของ Load Balancer เพื่อให้สามารถจำแนกออกจาก Load Balancer ตัวอื่นได้

{% hint style="info" %}
แนะนำให้ Load Balancer และ Compute Instance ที่จะมาเป็น Member ของ Backend Group อยู่บน Availability Zone เดียวกัน เพื่อ performance สูงสุด
{% endhint %}

<figure><img src="/files/tQYr5BgGwXuxTUpaLVOY" alt=""><figcaption><p>Create Load Balancer - Detail</p></figcaption></figure>

### 4. เลือก Purpose ของ Load Balancer

เลือก Purpose ของ Load Balancer โดยคำนึงจากรูปแบบการใช้งาน โดย&#x20;

* **Development** เหมาะสำหรับงานที่รับการแปรผันของ performance ได้เล็กน้อย หรืองานใน environment test โดยจะมีแต่ standalone topology เท่านั้น
* **Production** เหมาะสำหรับงานที่ต้องการความเสถียรของ performance โดยจะมี topology ทั้งแบบ standalone และ high availability

<figure><img src="/files/hfuLAk2psW20H8IY5E9d" alt=""><figcaption><p>Create Load Balancer - Purpose</p></figcaption></figure>

### 5. เลือก Specification ของ Load Balancer

เลือก Topology และ Specification หรือขนาดของ Load Balancer ว่าต้องการรองรับการทำงานระดับใด และ ยอมรับ downtime ได้นานแค่ไหน โดย

Topology จะระบุจำนวนเครื่อง compute ที่ทำงานเป็น Load Balancer โดยมี 2 รูปแบบ คือ

* Standalone มี compute 1 เครื่อง ในกรณีที่ compute มีปัญหา จะมีการ self-healing ขึ้นมาภายใน 5 นาที
* High Availability มี compute 2 เครื่อง ทำงานแบบ active/standby ทำให้เมื่อ compute ที่ Active มีปัญหา จะสามารถสลับมาใช้ standby compute ได้ ภายใน 5 วินาที

<figure><img src="/files/5et9nYSRbzcjoavnWqbL" alt=""><figcaption><p>Create Load Balancer - Specification</p></figcaption></figure>

### 6. เลือก Virtual Network และ External Network

เลือก VPC Network สำหรับใช้งานเป็น Virtual Network ของ Load Balancer และ ตัวเลือก External IP กรณีที่ต้องการออก public internet

{% hint style="info" %}
แนะนำให้ Load Balancer ใช้ VPC Network เดียวกันกับ Compute Instance ที่จะมาเป็น Member ของ Backend Group
{% endhint %}

<figure><img src="/files/hcrGzd1Zfh0GYWYjGbvA" alt=""><figcaption><p>Create Load Balancer - Network</p></figcaption></figure>

### 7. ตรวจสอบการตั้งค่าของ Load Balancer ก่อน Confirm การสร้าง

ตรวจสอบความถูกต้องของการตั้งค่า และกดปุ่ม CREATE เพื่อสร้าง Load Balancer

<figure><img src="/files/zGFxlPI9kJlELHczFR9Z" alt=""><figcaption><p>Create Load Balancer - Summary</p></figcaption></figure>

### 9. ดูรายละเอียดของ Load Balancer ที่สร้าง

รอจน Load Balancer Status กลายเป็น HEALTHY และกดที่ชื่อของ Load Balancer เพื่อเข้าหน้า Load Balancer Detail

<figure><img src="/files/XjKi9NFleoaqVbUEMGSD" alt=""><figcaption><p>Load Balancer List</p></figcaption></figure>

### 10. สร้าง Backend Group&#x20;

ในหน้า Load Balancer Detail ที่ tab Overview จะแสดงรายละเอียดของ Load Balancer โดยจะต้องสร้าง Backend Group เพื่อเริ่มใช้งาน โดยกดปุ่ม CREATE BACKEND GROUP ที่แถบ menu ด้านบน หรือ instruction card ที่ด้านขวาบน

<figure><img src="/files/nBE10HaQ5fOy6u1kVeRB" alt=""><figcaption><p>Load Balancer Overview - Create Backend Group Button</p></figcaption></figure>

ในขั้นตอนต่อจากนี้ จะเป็นการแยกประเภทของ Load Balancing ที่ต้องการใช้งาน จะที่จะเป็น Network Load Balancing หรือ Application Load Balancing โดยให้ทางการเลือกรูปแบบนี้ต้องการจากตัวเลือกด้านล่าง

* หากต้องการใช้ Network Load Balancing [Using Network Load Balancing](/ncs-documents/load-balancing/load-balancer/using-network-load-balancing.md)
* หากต้องการใช้ Application Load Balancing [Using Application Load Balancing](/ncs-documents/load-balancing/load-balancer/using-application-load-balancing.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs-epc.gitbook.io/ncs-documents/load-balancing/load-balancer/create-load-balancer.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
