Step 5: Allow integrating vLB into Containers service of GreenNode
Demand: Customers need to deploy 2 websites: httpd.app.com and nginx.app.com according to microservice architecture on GreenNode infrastructure.
Solution: Use vLB (Load Balancer) service in combination with vContainer service on GreenNode.
Solution architecture:

Deployment
Step 1: Initialize vLB and vContainer
1. Create Network LoadBalancer(Layer 4)
\

Note: Như ở trên, chúng ta sẽ tạo 1 Listener trên Port 80. Nếu muốn sử dụng TLS cho website, có thể tạo thêm Listener trên Port 443 và cấu hình TLS ở LoadBalancer Controller. Bài này sẽ chỉ triển khai với Listener Port 80. \

\

2. Choose Create Load Balancer to create vLB
3. Then access the K8S creation control panel at the link: https://hcm-3.console.vngcloud.vn/vserver/container/cluster:

\
Note: When creating vContainer, we can choose Enable LoadBalancer Controller to create cluster with LoadBalancer Controller already deployed. To use the LoadBalancer Controller with the right features according to the needs of the application, in this article, we will not select Enable LoadBalancer Controller but will implement the Nginx LoadBalancer Controller yourself, so you need to disable Ingress Control when initializing K8S.
4. Check the cluster initialization and download the config file to access the cluster:

\

Step 2: Deploy Nginx LoadBalancer Controller
Copy and run the above command to deploy Nginx LoadBalancer Controller: \

Check: → So we have successfully deployed Nginx LoadBalancer Controller. Service ingress-nginx-controller is initialized with Type: NodePort and listens on Port: 30398, 31873 of Minion Nodes.

Step 3: Attach vLB to vContainer
Note: By default vLB cannot connect to vContainer Cluster even though it is in the same VPC/Subnet. Therefore, it is necessary to create a new Security Group and attach it to Minion Node.
Create Security Group: Since there is only 1 Listener Port 80 on vLB, only 1 Inbound rule is needed. In case there is a Listener Port 443, please create an Inbound rule. \

Update Security Group for Minion Node: \

Enter 30398. Then the Listener will forward traffic to the Backend Pool with port 30398. vLB will periodically health check Pool Members through Monitor Port, traffic will not be sent to members who do not have a successful health check: \

Click Save to finish attaching vLB to vContainer
Step 4: Deploy the application
Prepare YAML files: service.yaml, deployment.yaml and app-ingress.yaml: \

Deployment: \


Check Review the vLB status:\

Edit hosts file on personal laptop to check: C:\Windows\System32\drivers\etc\hosts: \

Open a web browser and check:\

\
Last updated


