Load Balancing
Uplift Topic 3: Simplified configuration for load balancing
Load balancing VMs typically requires multiple different tools and configurations to work properly. For example, to load balance two VMs internally and externally you might:
-
Create a private internal load balancer
-
Create an internet facing endpoint and route it to the internal load balancer
-
Create private DNS records for the internal load balancer
-
Create public DNS records for the public endpoint for external access
-
Register VMs with the load balancer
-
Configure the listening/forwarding port or port translation
-
Configure health check endpoints and tests
-
Configure health check timeouts and intervals
Networking and load balancing within OpenShift has been trivialized - let’s walk through the steps to setup internal and external load balancing within OpenShift.
Setting Up Load Balancing
-
Go to your “windowsnetworking” namespace, on the left hand side click the “Virtualization” tab
-
Click “VirtualMachines” and click on the winnetworking1 VM. Click the “YAML” tab and search for “app: winnetworking”. This is an arbitrary label assigned to both VMs.
-
On the left side of the console, click to expand “Networking”. Click “Services”.
-
In the top right corner, click “Create Service”. On line 4, change the name to “windowsnetworking”.
-
Modify line 8 to read “app: winnetworking”
-
Change the “targetPort:” value on line 12 to 80 then click “Create” in the bottom left corner
-
Click the “Pods” tab and notice that the two winnetworking VMs have already registered with the service object. This will allow applications within the OpenShift cluster to access these VMs through the windowsnetworking “load balancer”.
-
On the left side, under “Services”, click “Routes” then click “Create Route”.
-
In the “Name” field put windowsnetworking
-
Click the drop down box below “Service” and select the windowsnetworking service you just created.
-
Click the drop down box below “Target port” and select port 80 then click “Create” in the bottom left corner.
-
In the middle right, see the “Location” section.
-
Click the link to view your load balanced virtual machines.
if this step fails, check to see if your browser redirected the http connection to https |