The new Load Balancer (LB) feature for the NextGen Gateway improves traffic management and service availability by consolidating services under a single external IP. This feature can be deployed in two ways:
- Enabling the new Load Balancer on a fresh setup
- Migrating an existing deployment to use the Load Balancer
Enabling the New Load Balancer
To enable the Single Load Balancer (LB) Controller feature, use the provided helper script that automates all necessary configuration changes.
Using the Helper Script
- Contact OpsRamp Support to obtain the
enable-single-lb-controller.sh
script. - Place the script on the NextGen Gateway server.
- Make the script executable:
chmod +x enable-single-lb-controller.sh
- Run the script with your desired action:
./enable-single-lb-controller.sh [ACTION] [NAMESPACE] [REPOSITORY_OPTION]
Available Actions:
Action | Description |
---|---|
enable | Enables the Single LB Controller feature |
disable | Disables the feature and reverts to the original setup |
opsramp-agent-migrated | Marks agent migration as complete (run after all agents are updated) |
Examples:
# Enable the feature in the default namespace
./enable-single-lb-controller.sh enable default
# Disable the feature in the monitoring namespace
./enable-single-lb-controller.sh disable monitoring
# Mark agent migration as complete in the default namespace
./enable-single-lb-controller.sh opsramp-agent-migrated default
# Enable using an alternative chart repository
./enable-single-lb-controller.sh enable default repo=harbor-docker.pkg.dev
Tip
Always use this script to manage the Single LB Controller feature. Avoid making direct configuration changes, as it may cause inconsistent behavior.Migration Steps for Existing Deployments
When upgrading existing Gateway deployments to use the new Load Balancer feature, follow these steps:
- Enable the Single LB Controller:
./enable-single-lb-controller.sh enable <NAMESPACE>
- Update your agents to point to the new Squid proxy service.
- During migration, both old and new Squid proxy services will be available temporarily.
- Gradually update your agents to use the new service.
- After all agents have been updated, mark the migration as complete:
./enable-single-lb-controller.sh opsramp-agent-migrated <NAMESPACE>
Note
- If the Migration Completed, flag is enabled:
The originalsquid-proxy
service using the old IP (if it exists) will be discontinued and no longer accessible. - If the Migration Completed, flag is not enabled:
The originalsquid-proxy
service will continue to operate using the old IP as usual.
- If the Migration Completed, flag is enabled:
- Future upgrades will no longer use the original Squid proxy service.
Tip
The dual-service transition ensures continuous agent operation during migration.
Verifying the Configuration
After enabling the Load Balancer feature, verify that it is working as expected:
- Verify if the Load Balancer controller pod is running.
kubectl get pods -n <NAMESPACE> | grep lb-controller
- List all services and confirm the consolidated external IP.
kubectl get svc -n <NAMESPACE>
You should see the LB Controller pod running and services using a single external IP.
Disable the Load Balancer
If you want to disable the Load Balancer and revert to the previous configuration, run:
./enable-single-lb-controller.sh disable <NAMESPACE>
This will disable the Single LB Controller feature and restore the original setup.
Advanced Auto-Scaling Configuration
Modify scaling parameters in values.yaml for optimal scaling:
squid:
hpa:
minReplicas: 1 # Minimum instances
maxReplicas: 5 # Maximum instances
metrics:
memory:
averageUtilization: 80 # Trigger scaling at 80% memory usage
Troubleshooting
If issues arise, follow these steps:
- Check Load Balancer Logs:
kubectl logs -f nextgen-gw-lb-controller-[hash] -n <namespace>
- View Load Balancer Controller Pod Details:
kubectl describe pod nextgen-gw-lb-controller-[hash] -n <namespace>
- Verify MetalLB Status:
kubectl get pods -n kube-system
- Check Squid Proxy Services:
kubectl get pods -n <namespace> | grep squid
kubectl get svc -n <namespace> | grep squid