Chapter 5. Creating Load-balancing service flavors
Load-balancing service (octavia) flavors are sets of provider configuration options that the Red Hat OpenStack Services on OpenShift (RHOSO) administrator creates. When RHOSO users request load balancers, they can specify that the load balancer be built using one of the defined flavors.
The administrator can define one or more flavors for each load-balancing provider driver, which exposes the unique capabilities of the respective provider.
Load-balancing flavors are supported only on the amphora provider.
To create a new Load-balancing service flavor:
- Decide which capabilities of the load-balancing provider you want to configure in the flavor.
- Create the flavor profile with the flavor capabilities you have chosen.
Create the flavor.
The Load-balancing service ships with a pre-defined, enhanced flavor that enables cloud users to scale up their load balancing instances to 4 vCPUs, 4GB RAM, and 3GB of disk space. By performing the steps in the following sections, RHOSO administrators can create their own custom flavors that meet the unique requirements to help their site vertically scale. For more information, see Section 5.4, “Vertically scaling load balancers”.
5.1. Reviewing Load-balancing service provider capabilities Copy linkLink copied to clipboard!
Before creating a Load-balancing service (octavia) flavor, the Red Hat OpenStack Services on OpenShift (RHOSO) administrator should know the capabilities that each provider driver exposes.
Prerequisites
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - The Load-balancing service uses the amphora provider.
Procedure
Access the remote shell for the OpenStackClient pod from your workstation:
$ oc rsh -n openstack openstackclientList the capabilities for each driver:
$ openstack loadbalancer provider capability list <provider>Replace
<provider>with the name or UUID of the provider.- Example
$ openstack loadbalancer provider capability list amphoraThe command output lists all of the capabilities that the provider supports.
- Sample output
+-----------------------+---------------------------------------------------+ | name | description | +-----------------------+---------------------------------------------------+ | loadbalancer_topology | The load balancer topology. One of: SINGLE - One | | | amphora per load balancer. ACTIVE_STANDBY - Two | | | amphora per load balancer. | | ... | ... | +-----------------------+---------------------------------------------------+
- Note the names of the capabilities that you want to include in the flavor that you are creating. You will use these capability names later when you create the profile for the flavor.
Exit the
openstackclientpod:$ exit
Next step
- Proceed to Section 5.2, “Defining flavor profiles”.
5.2. Defining flavor profiles Copy linkLink copied to clipboard!
Red Hat OpenStack Services on OpenShift (RHOSO) Load-balancing service (octavia) flavor profiles contain the provider driver name and a list of capabilities. RHOSO administrators use a flavor profile to create a flavor that RHOSO users will specify when they create a load balancer.
Prerequisites
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. You must know which load-balancing provider and which of its capabilities you want to include in the flavor profile.
For more information, see Section 5.1, “Reviewing Load-balancing service provider capabilities”.
Procedure
Access the remote shell for the OpenStackClient pod from your workstation:
$ oc rsh -n openstack openstackclientCreate a flavor profile:
$ openstack loadbalancer flavorprofile create --name <profile_name> --provider <provider_name> --flavor-data '{"<capability>": "<value>"}'- Example
In this example, a flavor profile is created for the amphora provider. When this profile is specified in a flavor, the load balancer that users create by using the flavor is a single amphora load balancer.
$ openstack loadbalancer flavorprofile create --name amphora-single-profile \ --provider amphora --flavor-data '{"loadbalancer_topology": "SINGLE"}'- Sample output
+---------------+--------------------------------------+ | Field | Value | +---------------+--------------------------------------+ | id | 72b53ac2-b191-48eb-8f73-ed012caca23a | | name | amphora-single-profile | | provider_name | amphora | | flavor_data | {"loadbalancer_topology": "SINGLE"} | +---------------+--------------------------------------+
Verification
- When you create a flavor profile, the Load-balancing service validates the flavor values with the provider to ensure that the provider can support the capabilities that you have specified.
Next step
5.3. Creating Load-balancing service flavors Copy linkLink copied to clipboard!
Red Hat OpenStack Services on OpenShift (RHOSO) administrators create a user-facing flavor for the Load-balancing service (octavia) by using a flavor profile. The name that you assign to the flavor is the value that a RHOSO user will specify when they create a load balancer.
Prerequisites
-
You have the
occommand line tool installed on your workstation. -
You are logged on to a workstation that has access to the RHOSO control plane as a user with
cluster-adminprivileges. - You must have created a flavor profile.
- The Load-balancing service uses the amphora provider.
Procedure
Access the remote shell for the OpenStackClient pod from your workstation:
$ oc rsh -n openstack openstackclientCreate a flavor:
$ openstack loadbalancer flavor create --name <flavor_name> \ --flavorprofile <flavor-profile> --description "<string>"TipProvide a detailed description so that users can understand the capabilities of the flavor that you are providing.
- Example
In this example, a flavor has been defined. When users specify this flavor, they create a load balancer that uses one Load-balancing service instance (amphora) and is not highly available.
$ openstack loadbalancer flavor create --name standalone-lb --flavorprofile amphora-single-profile --description "A non-high availability load balancer for testing."- Sample output
+-------------------+--------------------------------------+ | Field | Value | +-------------------+--------------------------------------+ | id | 25cda2d8-f735-4744-b936-d30405c05359 | | name | standalone-lb | | flavor_profile_id | 72b53ac2-b191-48eb-8f73-ed012caca23a | | enabled | True | | description | A non-high availability load | | | balancer for testing. | +-------------------+--------------------------------------+NoteDisabled flavors are still visible to users, but users cannot use the disabled flavor to create a load balancer.
5.4. Vertically scaling load balancers Copy linkLink copied to clipboard!
Red Hat OpenStack Services on OpenShift (RHOSO) users can scale-up their load balancers, increase the CPU and RAM of the load-balancing instance, to improve performance and capacity. Vertically scaling a load increases the maximum number of concurrent connections and the volume of network traffic processed.
To scale up a load balancer, use the appropriate load-balancing flavor when you create a load balancer. RHOSO ships with amphora-4vcpus which creates an instance that contains 4 vCPUs, 4GB RAM, and 3GB of disk space. The amphora-4vcpus flavor also automatically uses an amphora image that enables CPU pinning in the VM. One vCPU is dedicated to the system, and three vCPUs are dedicated to HAProxy.
Your RHOSO administrator can create other custom load-balancing flavors that meet the load-balancing needs of your particular environment.
Prerequisites
-
The administrator has created a project for you and has provided you with a
clouds.yamlfile for you to access the cloud. The
python-openstackclientpackage resides on your workstation.$ dnf list installed python-openstackclient- The Load-balancing service uses the amphora provider.
- Your RHOSO administrator has provided you with an enhanced, load-balancing flavor.
Procedure
Confirm that the system
OS_CLOUDvariable is set for your cloud:$ echo $OS_CLOUD my_cloudReset the variable if necessary:
$ export OS_CLOUD=my_other_cloudAs an alternative, you can specify the cloud name by adding the
--os-cloud <cloud_name>option each time you run anopenstackcommand.Create a load balancer using the load-balancing flavor provided.
EXAMPLE
In this example, a non-secure HTTP load balancer (
lb1) is created on a public subnet (public_subnet), using the flavor (amphora-4vcpus):$ openstack loadbalancer create --name lb1 \ --vip-subnet-id public_subnet \ --flavor amphora-4vcpus --wait