Fleet Management
Overview
Fleet Management is a feature that helps group Kubernetes clusters across multiple zones/regions , allowing flexible traffic management between clusters. When using Global Load Balancer (GLB) , there are two main traffic distribution mechanisms:
North-South Traffic Management with GLB
How it works : A single GLB will route traffic to clusters by geographic region (eg: HAN, HCM...), helping to optimize performance and reduce costs compared to using multiple individual Load Balancers.
Support for clusters with Network Type:
✅ Calico Overlay ✅ Cilium Overlay ✅ Cilium VPC Native
East-West Traffic Management with MCS
How it works : If a backend service in a cluster fails, traffic will failover to the backends of other clusters in the fleet , ensuring no downtime .
Only supports clusters with Network Type :
✅ Cilium VPC Native
Create fleet
Follow these instructions to create a Fleet and manage traffic distribution with GLB:
Step 1: Log in to VKS Portal at the link: https://vks.console.vngcloud.vn/overview
Step 2: Select Fleet Management
Step 3: Select Create a fleet

Step 4: Enter a memorable name for the fleet in the Fleet Name field . The Fleet name must be between 5 and 50 characters long, including the characters a-z, 0-9, '-'
Step 5: Select the Region containing your Cluster
Step 6: Select the cluster list you want to add to the fleet and select Register .
Step 7: In the list of added Clusters , you need to specify a cluster as host . The remaining Clusters will be members . For example, in the picture, I specify the cluster named demo-fleet-03 as host and the cluster named demo-cluster-04 as member.
Step 8: Select the type of Traffic flow you want, depending on the Network type of the cluster you have selected, the type of Traffic flow you can choose will be displayed accordingly.
Step 9: Select Create

Step 10: Deploy a service on the host cluster. First, you need to download the KubeConfig of the Host Cluster and connect to this host cluster. After downloading the KubeConfig file and updating it to a config file in the directory ~/.kube, you can check the connection to the cluster with the command:
kubectl get nodesNext, let's implement a service, which:
With Traffic Flow: East West Traffic Management with Multi Cluster Service : you can create service type LoadBalancer, NodePort or ClusterIP.
With Traffic Flow: North South Traffic Management with GLB : you can create service type LoadBalance or NodePort .
For example below, I create a file nginx.yamlcontaining nginx service type LoadBalancer at namespace default:
apiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-app
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx:1.18.0
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80kubectl apply -f nginx.yamlStep 11: Create a file glb-nginx.yamlcontaining the GLB service using the following sample YAML:
apiVersion: vks.vngcloud.vn/v1alpha1
kind: VngcloudGlobalLoadBalancer
metadata:
name: nginx-service
namespace: defaultStep 12: Apply GLB configuration using command:
kubectl apply -f glb-nginx.yamlReplace glb-nginx.yamlwith your YAML file name.
At this time, the system will create a new vGLB on the vGLB system, you can check the created vGLB here .

Step 13: Check the status of GLB with the command:
kubectl get vngcloudgloballoadbalancer -n defaultYou will see a list of created GLBs along with their status.
For example:
NAME FLEET ID GLB ID ADDRESS
AGE
nginx-service fl-cadc9e8c-0930-44aa-a37f-cb330a8c4af9 glb-09108dcc-5d3d-4067-8700-02941acd7d68 vks-fl-cadc9e8-default-nginx-serv-33be0-53461-2354c.glb.vngcloud.vn 4h30mStep 14: Get the IP address or hostname of GLB to access the service using the command:

Step 15: Test Fleet's performance by sending a request to GLB:
curl http://<GLB_Endpoint>Replace <GLB_Endpoint>with the IP address or hostname obtained from the step above.
For example:
curl http://vks-fl-25757a5-default-nginx-serv-33a00-53461-38e3a.glb.vngcloud.vn
StatusCode : 200
StatusDescription : OK
Content : <!DOCTYPE html>
<html>
<head>
<title>Welcome to nginx!</title>
<style>
body {
width: 35em;
margin: 0 auto;
font-family: Tahoma, Verdana, Arial, sans-serif;
}
</style>
<...
RawContent : HTTP/1.1 200 OK
Connection: keep-alive
Accept-Ranges: bytes
Content-Length: 612
Content-Type: text/html
Date: Fri, 28 Feb 2025 08:48:50 GMT
ETag: "5e9efe7d-264"
Last-Modified: Tue, 21 Apr 2020 ...
Forms : {}
Headers : {[Connection, keep-alive], [Accept-Ranges, bytes], [Content-Length, 612], [Content-Type, text/html]...}
Images : {}
InputFields : {}
Links : {@{innerHTML=nginx.org; innerText=nginx.org; outerHTML=<A href="http://nginx.org/">nginx.org</A>; outerText=nginx.org; tagName=A; href=http://nginx.org/}, @{innerHTML=nginx.com;
innerText=nginx.com; outerHTML=<A href="http://nginx.com/">nginx.com</A>; outerText=nginx.com; tagName=A; href=http://nginx.com/}}
ParsedHtml : mshtml.HTMLDocumentClass
RawContentLength : 612Or access directly as picture:

Check North-South Traffic with GLB
Suppose, you have initialized Fleet with 2 clusters on 2 regions HAN, HCM and selected Flow Traffic as GLB. The general steps to perform the test are as follows:
First, on Host Cluster, you need to deploy glb-nginx.yaml to create GLB via command:
kubectl apply -f glb-nginx.yamlNext, on each Cluster A, B, you create a deploy nginx service but you need to edit the service output to Hello Nginx HAN, Hello Nginx HCM to easily observe how traffic is distributed.
On Cluster A in Region HCM:
Create files
nginx-configmap.yamlandnginx.yamlfollowing the pattern, deploy them on cluster A:
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-custom-page
namespace: default
data:
index.html: |
Hello Nginx HCMkubectl apply -f nginx-configmap.yamlapiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-app
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: nginx-html
mountPath: /usr/share/nginx/html/
volumes:
- name: nginx-html
configMap:
name: nginx-custom-page
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80kubectl apply -f nginx.yamlOn Cluster B in Region HAN:
Create files
nginx-configmap.yamlandnginx.yamlfollowing the pattern, deploy them on cluster A:
apiVersion: v1
kind: ConfigMap
metadata:
name: nginx-custom-page
namespace: default
data:
index.html: |
Hello Nginx HANkubectl apply -f nginx-configmap.yamlapiVersion: apps/v1
kind: Deployment
metadata:
name: nginx-app
spec:
selector:
matchLabels:
app: nginx
replicas: 1
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
volumeMounts:
- name: nginx-html
mountPath: /usr/share/nginx/html/
volumes:
- name: nginx-html
configMap:
name: nginx-custom-page
---
apiVersion: v1
kind: Service
metadata:
name: nginx-service
spec:
selector:
app: nginx
type: LoadBalancer
ports:
- protocol: TCP
port: 80
targetPort: 80kubectl apply -f nginx.yamlFinally, on ClusterA, B, do curl to GLB_Domain.
On Cluster A in Region HCM:
kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-app-5dc57d48b6-phtz4 1/1 Running 0 23mkubectl exec nginx-app-5dc57d48b6-phtz4 -it -- curl vks-fl-c4289d0-default-nginx-serv-82e59-53461-93a04.glb.vngcloud.vnThe curl result will be as follows:
Hello Nginx HCMOn Cluster B in Region HAN:
kubectl get pod
NAME READY STATUS RESTARTS AGE
nginx-app-5dc57d48b6-tvc5f 1/1 Running 0 16hCopy
kubectl exec nginx-app-5dc57d48b6-tvc5f -it -- curl vks-fl-c4289d0-default-nginx-serv-82e59-53461-93a04.glb.vngcloud.vnThe curl result will be as follows:
Hello Nginx HANCheck East-West Traffic with MCS
Test failover by shutting down the backend service in one cluster and observing how traffic is distributed to another cluster in Fleet:
For example, on a Cluster belonging to Region HAN, I perform scale deployment with the command:
kubectl scale deployment nginx-app --replicas=0 -n defaultAt this time, all traffic will be transferred to the cluster in Region HCM, you can check by curling to GLB Endpoint:
curl vks-fl-c4289d0-default-nginx-serv-82e59-53461-93a04.glb.vngcloud.vnThe curl result will be as follows:
Hello Nginx HCMAfter completing the above steps, you have successfully set up Fleet Management on VKS with Global Load Balancer to effectively manage traffic between clusters.
Register and unregister a cluster to the fleet
After creating a Fleet, you can add existing Kubernetes clusters to the Fleet in two ways:
Method 1: In Fleet Management , select Edit Fleet then select a cluster from the available list and click "Register" to add to Fleet.


Method 2: Register the cluster directly to Fleet during the cluster creation process.

If you no longer need a cluster in Fleet, you can Unregister it by:
Step 1: Access the Fleet Management section .
Step 2: Select the cluster to remove.
Step 3: Click "Remove" or "Unregister" (only delete cluster from Fleet, not delete cluster from VKS system).


Changing host clusters within a fleet
Once you create a Fleet, you can edit its configuration:
Change Host Cluster in existing Fleet.
Add or remove cluster members as needed, but always ensure Fleet has at least one cluster host.

Delete a fleet
When you no longer need a Fleet, you can delete it by:
Step 1: Access Fleet Management .
Step 2: Select the Fleet to delete.
Step 3: Click "Delete" and confirm.

Last updated
