Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In this guide, we exemplify the procedure procedures based on (1) the ADA Cloud Horizon Dashboard and (2) the OpenStack CLI and the OpenStack Octavia plugin with , for a simple use case: the deployment of a basic HTTP load balancer with an associated Floating-IP.  For further details and additional use cases, including step-by-step examples, refer to the Octavia Basic Load Balancing Cookbook. This resource provides comprehensive instructions on applying the same procedure to various scenarios. 

...

In this section, we will walk you through the steps to create a setup where two instances running nginx servers are connected to an HTTP load balancer. The load balancer will use the round-robin algorithm to evenly distribute incoming HTTP traffic across the two servers. 

Environment requirements

1. You will need the OpenStack Client and the Octavia plugin.  

...

...

pip install python-octaviaclient

2. Follow the instructions provided in the ADA Cloud User Guide on how to setup your cloud environment and  the OpenStack CLI.

Prerequisites 

1. Before creating a load balancer, ensure that the following resources are available in your tenant:

...

Code Block
sudo apt-get update 
sudo apt-get install -y nginx && \
    echo "Hello! This is $(hostname)" > /var/www/html/index.html

Procedure with ADA Cloud Horizon Dashboard

1. Create the loadbalancer by clicking on "Project → Network → Load Balancers → "Create Load Balancer" and setting the following information.

    1. Load Balancer Details:
      • Name.
      • Subnet. Select the desired subnet.
        Image Added
    2. Listener Details:
      • Name.
      • Protocol and Port. The protocol defines the type of network traffic the listener will handle, while the port specifies the network port on which the listener will accept incoming traffic. In our example we select protocol HTTP and port 80.
        Image Added
    3. Pool Details:
      • Name.
      • Algorithm. The algorithm determines how traffic is distributed across the members. We select ROUND_ROBIN.
        Image Added
    4. Pool Members:
      • Add members. Choose the desired members among those available. We add VM-1 and VM-2, the names of the VMs in our example. 
      • Port. For each VM, specify the port number on which the member will receive traffic. In our case, we expose the nginx server on port 80.
      • Weight. The weight of the member for load balancing purposes. The weight determines the relative portion of requests the member should handle compared to others. We use the default value.
        Image Added
    5. Monitor Details: Decide whether you'd like to create a Health Monitor. In this example, we will not make use of a monitor. 
      Image Added

Once all the details are provided, click on "Create Load Balancer"

2. Make sure that the load balancer has a floating-PI associated to it. To associate a floating-IP to your brand new load balancer, move to the "Project → Network → Load Balancers" Section of the left hand menu of the dashboard. Then, display the options within the drop-down menu on the right side for the desired load balancer, and click on "Associate Floating IP".  Then, select the floating IP among those suggested in the drop-down menu "Floating IP adress or Pool". Finally, click on "Associate". The floating-IP associated to the load balancer appears in the overview of its characteristics. In order to see them, click on the name of your load balancer in the "Project → Network → Load Balancers" Section of the dashboard.

Image Added

Image Added

3. Test your load balancer.

Use this floating-IP to reach the nginx servers (see figure bellow). The traffic will be managed by the load balancer following the algorithm ROUND_ROBIN.

Image Added

Procedure with OpenStack CLI

Environment requirements

1. You will need the OpenStack Client and the Octavia plugin.  

Code Block
pip install python-octaviaclient

2. Follow the instructions provided in the ADA Cloud User Guide on how to setup your cloud environment and  the OpenStack CLI.

Procedure

1. Request to be enabled to the service

...