# 1. Các bước tạo Kubernetes Cluster trên HI GIO Portal

## <mark style="color:green;">**Tổng quan**</mark> <a href="#overview" id="overview"></a>

Tài liệu này giải thích cách tạo một Kubernetes Cluster trên **HI GIO**, bao gồm việc lựa chọn cấu hình, triển khai các node và khởi tạo **control plane**.

## <mark style="color:green;">Quy trình</mark> <a href="#id-2.-guidance" id="id-2.-guidance"></a>

{% tabs %}
{% tab title="I. Điều Kiện" %}

* Tạo mạng cho Cluster với các Static IP Pools khả dụng.
* Tạo các quy tắc Firewall và SNAT để đảm bảo các VM trong Cluster có thể truy cập internet.
* Đảm bảo tính năng HI GIO Load Balancing đã được kích hoạt.
* Đảm bảo có ít nhất một địa chỉ Public IP khả dụng.
  {% endtab %}

{% tab title="II. Hướng dẫn thực hiện" %}
**Bước 1**: Đăng nhập vào **HI GIO portal** bằng tài khoản tenant > Click More > Kubernetes Container Clusters

<figure><img src="/files/CUfYpGyiHGxVhbJEFMep" alt=""><figcaption></figcaption></figure>

Bước 2: Bấm vào **NEW** và làm theo các bước tạo để hoàn tất quá trình tạo mới HI GIO Kubernetes cluster.

* Nhấn **NEXT**

  <div align="left"><figure><img src="/files/Liz2NtimI228D9X8IDtl" alt=""><figcaption></figcaption></figure></div>
* Nhập tên của Cluster và chọn phiên bản Kubernetes. > **NEXT.**

<figure><img src="/files/3MjyMRobUlu2yi0cbZWw" alt=""><figcaption></figcaption></figure>

* Chọn **NEXT** ở bước 3.

{% hint style="info" %}
**Lưu ý:** Hiện tại, tính năng liên kết các Cluster với Tanzu Mission Control không được hỗ trợ.
{% endhint %}

<figure><img src="/files/mE4yxDKQUUa2Er1RECWM" alt=""><figcaption></figcaption></figure>

* **Chọn oVDC và Network** cho các node, sau đó nhấn **NEXT**

<figure><img src="/files/OQoWwGxzA6w7xnUkIQQt" alt=""><figcaption></figcaption></figure>

* Trong cửa sổ **Control Plane**, chọn số lượng node và dung lượng đĩa và tùy chọn (optional) Chọn **sizing policy**, **placement policy** và **storage profile** sau đó nhấn **NEXT.**

<figure><img src="/files/V2QCnfala0jSggwUJd0C" alt=""><figcaption></figcaption></figure>

| Các trường cài đặt  | Mô tả                                                                                                                                                                                                                          |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Số lượng Nodes      | <ul><li>Non-HA: <strong>1</strong></li><li>HA: <strong>3</strong></li></ul>                                                                                                                                                    |
| Dung lượng đĩa (GB) | Tối thiểu là **20 GB**                                                                                                                                                                                                         |
| Sizing Policy       | <ul><li><strong>TKG medium</strong>: Nếu số lượng của Worker node <strong>nhỏ hơn hoặc bằng</strong> 10 nodes.</li><li><strong>TKG large</strong>​: NNếu số lượng của Worker node <strong>lớn hơn</strong> 10 nodes.</li></ul> |
| Placement Policy    | Để trống, chúng tôi không áp dụng placement policy cho HI GIO Kubernetes cluster.                                                                                                                                              |
| Storage Policy      | Chọn một storage policy có sẵn.                                                                                                                                                                                                |

* Cấu hình cài đặt **Worker Pools** và nhấn **NEXT**.

<figure><img src="/files/ZaEAlsRWUuHVAZvJfmlV" alt=""><figcaption></figcaption></figure>

| **Trường**       | **Mô tả**                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Name             | Nhập tên Worker Pool.                                                                                                                                                                                                                                                                                                                                                                                                                                                          |
| Number of Nodes  | Nhập số lượng node cho Worker Pool.                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| Disk Size (GB)   | Dung lượng tối thiểu là **20 GB**.                                                                                                                                                                                                                                                                                                                                                                                                                                             |
| Sizing Policy    | <ul><li><strong>TKG small:</strong> Small VM sizing policy for a Kubernetes cluster node (2 CPU, 4GB memory)</li><li><strong>TKG medium</strong>: Medium VM sizing policy for a Kubernetes cluster node (2 CPU, 8GB memory)</li><li><strong>TKG large</strong>​: Large VM sizing policy for a Kubernetes cluster node (4 CPU, 16GB memory)</li><li><strong>TKG extra-large</strong>: Extra-large VM sizing policy for a Kubernetes cluster node (8 CPU, 32GB memory)</li></ul> |
| Placement Policy | Để trống. HI GIO không áp dụng placement policy cho HI GIO Kubernetes cluster.                                                                                                                                                                                                                                                                                                                                                                                                 |
| Storage Policy   | Chọn storage policy sẵn có                                                                                                                                                                                                                                                                                                                                                                                                                                                     |

{% hint style="info" %}
&#x20;**(Tùy chọn)**: Nếu cần thêm **Worker Node Pool**, nhấn **Add New Worker Node Pool** và cấu hình các trường tương tự.
{% endhint %}

* Cấu hình Storage Class > **NEXT**

<figure><img src="/files/28NabxIQe7TNzVfSbmPC" alt=""><figcaption></figcaption></figure>

| **Trường**               | **Mô tả**                                                                                                                                                                                                                                     |
| ------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Select a Storage Profile | Chọn một Storage Profile có sẵn.                                                                                                                                                                                                              |
| Storage Class Name       | <p>Tên của Storage Class. Tên phải tuân thủ các quy định sau:</p><ul><li>Tối đa 63 ký tự.</li><li>Chỉ chứa ký tự thường, số hoặc dấu gạch ngang (-). </li><li>Bắt đầu bằng ký tự chữ cái. </li><li>Kết thúc bằng ký tự chữ hoặc số.</li></ul> |
| Reclaim Policy           | <ul><li>Delete policy: Xóa PersistentVolume khi PersistentVolumeClaim bị xóa.</li><li>Retain policy: Giữ PersistentVolume khi PersistentVolumeClaim bị xóa (cần reclaim thủ công)..</li></ul>                                                 |
| Filesystem               | <ul><li>xfs</li><li>ext4: Đây là filesystem mặc định được sử dụng cho storage class.</li></ul>                                                                                                                                                |

* Cấu hình Kubernetes Network > **NEXT**

<figure><img src="/files/OsW9gXmqpDDs14cgXSyw" alt=""><figcaption></figcaption></figure>

| Tùy chọn              | Mô tả                                                                                                                                                                                                                                                                          |
| --------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| **Pods CIDR**         | Phạm vi địa chỉ IP sử dụng cho Pods. Mặc định: 100.96.0.0/11 (kích thước tối thiểu: /24).                                                                                                                                                                                      |
| **Services CIDR**     | Phạm vi địa chỉ IP sử dụng cho Services. Mặc định: 100.64.0.0/13..                                                                                                                                                                                                             |
| **Control Plane IP**  | Bạn có thể chỉ định địa chỉ IP của chính mình làm control plane endpoint. Nhập địa chỉ IP Public khả dụng từ Gateway hoặc địa chỉ IP nội bộ từ subnet khác.                                                                                                                    |
| **Virtual IP Subnet** | Bạn có thể chỉ định CIDR subnet mà từ đó một địa chỉ IP không sử dụng được chỉ định làm Control Plane Endpoint. Subnet phải đại diện cho một tập hợp các địa chỉ trong gateway. CIDR tương tự cũng được truyền bá dưới dạng CIDR subnet cho các ingress services trong cluster |

{% hint style="info" %}
Bạn nên nhập một Public IP có sẵn vào Control Plane IP
{% endhint %}

* Bật `Auto Repair on Errors` and `Node Health Check` > **NEXT**

<figure><img src="/files/719dJKOmuNLACLZR3nXu" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
**Auto Repair on Errors**: Nếu lỗi xảy ra trước khi Cluster khả dụng,CSE Server sẽ  cố gắng tự động sửa lỗi.

**Node Health Check**: Các node không ổn định sẽ được xử lý theo điều kiện và quy tắc khắc phục lỗi.
{% endhint %}

* Kiểm tra lại toàn bộ thông tin Cluster và nhấn **FINISH** để tạo Cluster.

<figure><img src="/files/nMCtOOJTPNeuAS2qCxGh" alt=""><figcaption></figcaption></figure>

**Bước 3:** Chờ trạng thái Cluster chuyển thành **Available** sau đó nhấn **DOWNLOAD KUBE CONFIG** để tải file kubeconfig.

<figure><img src="/files/R8NE2xXLuNaTeBv2lKnw" alt=""><figcaption></figcaption></figure>

{% hint style="info" %}
Vui lòng cấu hình VPC firewall để cho phép truy cập **Control Plane IP** qua cổng **6443.**
{% endhint %}
{% endtab %}
{% endtabs %}


---

# 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.higiocloud.vn/hi-gio-user-guide-vn/hi-gio-kubernetes/1.-cac-buoc-tao-kubernetes-cluster-tren-hi-gio-portal.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.
