A Kubernetes controller that provisions and manages VNGCloud load balancers
for clusters running on VNGCloud Kubernetes Service (VKS). It watches Service (type
LoadBalancer) and Ingress resources and reconciles the corresponding VNGCloud Network and
Application Load Balancers automatically.
Status: General availability. Latest release: see
charts/vngcloud-load-balancer-controller/Chart.yaml.
- L4 Load Balancing — Network Load Balancers for
Serviceresources of typeLoadBalancer. - L7 Load Balancing — Application Load Balancers driven by Kubernetes
Ingressresources. LoadBalancerConfigCRD — Fine-grained control over listeners, pools, policies, and TLS certificates.NodeSecurityGroupCRD — Declarative management of node security-group rules.GlobalLoadBalancerConfig/VngcloudGlobalLoadBalancerCRDs — Multi-region traffic distribution.- Annotation-driven configuration — Tune behaviour via
vks.vngcloud.vn/*annotations onService/Ingress. - Status conditions and Kubernetes events — Surfaces reconcile state on the owning resource for
kubectl describe. - Prometheus metrics — Built-in
/metricsendpoint for observability. - Leader election & graceful shutdown — Safe to run in HA deployments.
The controller follows a layered Controller → UseCase → Repository architecture:
Kubernetes Event
│
▼
EventHandler
│
▼
Controller (Reconciler)
│
▼
UseCase Layer ◄── Annotation Parser
│
├── K8s Repository ──► Kubernetes API
│
└── VNGCloud Repository ──► VNGCloud VLB API
| Layer | Responsibility |
|---|---|
| Controller | Watches Kubernetes resources, enqueues reconcile requests |
| UseCase | Business logic — desired state computation and reconciliation |
| Repository | I/O abstraction — Kubernetes API and VNGCloud API |
| Domain | Shared constants, finalizers, error types |
See the architecture overview in the documentation for a deeper dive.
- A running VKS (VNGCloud Kubernetes Service) cluster.
- Kubernetes v1.20+ (tested on current VKS-supported versions).
kubectlandhelmv3+.- VNGCloud IAM credentials (
Client IDandClient Secret) with permission to manage VLB resources.
Install via Helm from the official OCI registry:
# HCM region
helm install vngcloud-load-balancer-controller \
oci://vcr.vngcloud.vn/81-vks-public/vks-helm-charts/vngcloud-load-balancer-controller \
--namespace kube-system \
--set mysecret.global.clientID="<YOUR_CLIENT_ID>" \
--set mysecret.global.clientSecret="<YOUR_CLIENT_SECRET>" \
--set mysecret.global.vserverURL="https://hcm-3.api.vngcloud.vn/vserver"# HAN region
helm install vngcloud-load-balancer-controller \
oci://vcr-han.vngcloud.vn/81-vks-public/vks-helm-charts/vngcloud-load-balancer-controller \
--namespace kube-system \
--set mysecret.global.clientID="<YOUR_CLIENT_ID>" \
--set mysecret.global.clientSecret="<YOUR_CLIENT_SECRET>" \
--set mysecret.global.vserverURL="https://han-1.api.vngcloud.vn/vserver"Verify the install:
kubectl get pods -n kube-system -l app.kubernetes.io/name=vngcloud-load-balancer-controllerFor raw-manifest installation, upgrade procedures, and the full configuration reference, see the Installation guide, Configuration reference, and Upgrade guide.
apiVersion: v1
kind: Service
metadata:
name: my-app
annotations:
vks.vngcloud.vn/load-balancer-name: my-app-lb
spec:
type: LoadBalancer
selector:
app: my-app
ports:
- port: 80
targetPort: 8080apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: my-app
annotations:
vks.vngcloud.vn/load-balancer-name: my-app-alb
spec:
ingressClassName: vngcloud
rules:
- host: app.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: my-app
port:
number: 80More guides:
- Service (L4) · Ingress (L7)
LoadBalancerConfigCRDNodeSecurityGroupCRD- Global Load Balancer
- Annotations: Service · Ingress
- Examples: TLS termination · Internal LB · Custom health check
Full docs are published at https://vngcloud.github.io/vngcloud-load-balancer-controller/ and the
sources live under docs/.
- Gateway API support (design phase)
- End-to-end test suite
- Validating / mutating webhooks
- Out-of-band drift reconciliation (detect external load-balancer changes)
- Migration from
EndpointSlice(deprecatedv1.Endpointswatchers)
Contributions are welcome. See docs/contributing.md for the full
development setup, local-run instructions, code-generation workflow, and PR guidelines.
Quick reference:
make help # list all make targets
make test # run unit and integration tests
make lint lint-fix # static analysis
make install run # run the controller locally against the current kubeconfig- Issues / bug reports: https://github.com/vngcloud/vngcloud-load-balancer-controller/issues
- VNGCloud support: https://support.vngcloud.vn/
Copyright 2024 VNGCloud.
Licensed under the Apache License, Version 2.0. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.