Adopt the Load-balancing service

Adopt the Load-balancing service (octavia) by patching the existing OpenStackControlPlane custom resource (CR) where the Load-balancing service is disabled. The patch starts the service with the configuration parameters from Red Hat OpenStack Platform.

About this task

After data plane adoption, trigger a failover of existing load balancers to upgrade amphora virtual machines to use the new image and to establish connectivity with the new control plane.

Procedure

  1. Migrate the server certificate authority (CA) passphrase from the previous deployment:
    SERVER_CA_PASSPHRASE=$($CONTROLLER1_SSH grep ^ca_private_key_passphrase /var/lib/config-data/puppet-generated/octavia/etc/octavia/octavia.conf)
    
    oc apply -f - <<EOF
    apiVersion: v1
    kind: Secret
    metadata:
      name: octavia-ca-passphrase
    type: Opaque
    data:
      server-ca-passphrase: $(echo -n $SERVER_CA_PASSPHRASE | base64 -w0)
    EOF
  2. To isolate the management network, add the network interface for the VLAN base interface:
    $ oc get --no-headers nncp | cut -f 1 -d ' ' | grep -v nncp-dns | while read; do
    
    interfaces=$(oc get nncp $REPLY -o jsonpath="{.spec.desiredState.interfaces[*].name}")
    
    (echo $interfaces | grep -w -q "octbr\|enp6s0.24") || \
            oc patch nncp $REPLY --type json --patch '
    [{
        "op": "add",
        "path": "/spec/desiredState/interfaces/-",
        "value": {
          "description": "Octavia VLAN host interface",
          "name": "enp6s0.24",
          "state": "up",
          "type": "vlan",
          "vlan": {
            "base-iface": "<enp6s0>",
            "id": 24
            }
        }
    },
    {
        "op": "add",
        "path": "/spec/desiredState/interfaces/-",
        "value": {
          "description": "Octavia Bridge",
          "mtu": <mtu>,
          "state": "up",
          "type": "linux-bridge",
          "name": "octbr",
          "bridge": {
            "options": { "stp": { "enabled": "false" } },
            "port": [ { "name": "enp6s0.24" } ]
            }
        }
    }]'
    
    done

    where:

    <enp6s0>
    Specifies the name of the network interface in your RHOCP setup.
    <mtu>
    Specifies the mtu value in your environment.
  3. To connect pods that manage load balancer virtual machines (amphorae) and the OpenvSwitch pods the OVN operator manages, configure the Load-balancing service network attachment definition:
    $ cat  octavia-nad.yaml << EOF_CAT
    apiVersion: k8s.cni.cncf.io/v1
    kind: NetworkAttachmentDefinition
    metadata:
      labels:
        osp/net: octavia
      name: octavia
    spec:
      config: |
        {
          "cniVersion": "0.3.1",
          "name": "octavia",
          "type": "bridge",
          "bridge": "octbr",
          "ipam": {
            "type": "whereabouts",
            "range": "172.23.0.0/24",
            "range_start": "172.23.0.30",
            "range_end": "172.23.0.70",
            "routes": [
               {
                 "dst": "172.24.0.0/16",
                 "gw" : "172.23.0.150"
               }
             ]
          }
        }
    EOF_CAT
  4. Create the NetworkAttachmentDefinition CR:
    $ oc apply -f octavia-nad.yaml
  5. Enable the Load-balancing service in RHOCP:
    $ oc patch openstackcontrolplane openstack --type=merge --patch '
    spec:
      ovn:
        template:
          ovnController:
            networkAttachment: tenant
            nicMappings:
              octavia: octbr
      octavia:
        enabled: true
        template:
          amphoraImageContainerImage: quay.io/gthiemonge/octavia-amphora-image
          octaviaHousekeeping:
            networkAttachments:
              - octavia
          octaviaHealthManager:
            networkAttachments:
              - octavia
          octaviaWorker:
            networkAttachments:
              - octavia
    '
  6. Wait for the Load-balancing service control plane services CRs to be ready:
    $ oc wait --for condition=Ready --timeout=600s octavia.octavia.openstack.org/octavia
  7. Ensure that the Load-balancing service is registered in the Identity service:
    $ alias openstack="oc exec -t openstackclient -- openstack"
    $ openstack service list | grep load-balancer
    | bd078ca6f90c4b86a48801f45eb6f0d7 | octavia   | load-balancer |
    $ openstack endpoint list --service load-balancer
    +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+
    | ID                               | Region    | Service Name | Service Type  | Enabled | Interface | URL                                               |
    +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+
    | f1ae7756b6164baf9cb82a1a670067a2 | regionOne | octavia      | load-balancer | True    | public    | https://octavia-public-openstack.apps-crc.testing |
    | ff3222b4621843669e89843395213049 | regionOne | octavia      | load-balancer | True    | internal  | http://octavia-internal.openstack.svc:9876        |
    +----------------------------------+-----------+--------------+---------------+---------+-----------+---------------------------------------------------+

What to do next

After you complete the data plane adoption, you must upgrade existing load balancers and remove old resources. For more information, see Post-adoption tasks for the Load-balancing service.