|
| 1 | +// Module included in the following assemblies: |
| 2 | +// |
| 3 | +// IPI |
| 4 | +// * installing/installing_bare_metal/ipi/ipi-install-installation-workflow.adoc |
| 5 | +// * installing/installing_bare_metal/ipi/bare-metal-postinstallation-configuration.adoc |
| 6 | +// UPI |
| 7 | +// * installing/installing_bare_metal/upi/installing-bare-metal-network-customizations.adoc |
| 8 | +// * installing/installing_bare_metal/upi/installing-restricted-networks-bare-metal.adoc |
| 9 | +// * installing/installing_bare_metal/upi/installing-bare-metal.adoc |
| 10 | + |
| 11 | +:_mod-docs-content-type: PROCEDURE |
| 12 | +[id="enabling-OVS-balance-slb-mode_{context}"] |
| 13 | += Enabling OVS balance-slb mode for your cluster |
| 14 | + |
| 15 | +You can enable the Open vSwitch (OVS) `balance-slb` mode on infrastructure where your cluster runs so that two or more physical interfaces can share their network traffic. A `balance-slb` mode interface provides source load balancing (SLB) capabilities for a cluster that runs virtualization workloads, where the interface can act independently without needing to communicate with a network switch. |
| 16 | + |
| 17 | +Currently, source load balancing works by assigning a Media Access Control (MAC) address and a virtual local area network (vLAN), if required, to a bond interface, such as `br-phy`. Because of the shared MAC address and vLAN between interfaces, using `balance-slb` mode to share pod traffic has no benefit. |
| 18 | + |
| 19 | +The following diagram shows `balance-slb` mode on a simple cluster infrastructure layout. Virtual machines (VMs) connect to specific localnet `NetworkAttachmentDefinition` (NAD) custom resource definition (CRDs), `NAD 0` or `NAD 1`. Each NAD provides VMs with access to network traffic, such as VLAN ID tags. A `br-ex` OVS bridge receives traffic from VMs and passes the traffic to the next OVS bridge, `br-phy`. The `br-phy` bridge functions as the controller for the SLB bond. The SLB bond balances traffic from different VM ports over the physical interface links, such as `eno0` and `eno1`. Additionally, ingress traffic from either physical interface can pass through the set of OVS bridges to reach the VMs. |
| 20 | + |
| 21 | +.OVS `balance-slb` mode ` operating on a localnet with two NADs |
| 22 | +image::552_OpenShift_slb_mode_0625.png[OVS `balance-slb` mode ` operating on a localnet with two NADs] |
| 23 | + |
| 24 | +You can integrate the `balance-slb` mode interface into primary or secondary network types by using OVS bonding. Note the following points about OVS bonding: |
| 25 | + |
| 26 | +* Supports the OVN-Kubernetes CNI plugin and easily integrates with the plugin. |
| 27 | +* Natively supports `balance-slb` mode. |
| 28 | +* Cannot use the method external to your {product-title} cluster. |
| 29 | +
|
| 30 | +.Prerequisites |
| 31 | + |
| 32 | +* You have more than one physical interface attached to your primary network and you defined the interfaces in a `MachineConfig` file. |
| 33 | +* You created a manifest object and defined a customized `br-ex` bridge in the object configuration file. |
| 34 | +* You have more than one physical interfaces attached to your primary network and you defined the interfaces in a NAD file. |
| 35 | +
|
| 36 | +.Procedure |
| 37 | + |
| 38 | +. For each bare-metal host that exists in a cluster, in the `install-config.yaml` file for your cluster define a `networkConfig` section similar to the following example: |
| 39 | ++ |
| 40 | +[source,yaml] |
| 41 | +---- |
| 42 | +# ... |
| 43 | +networkConfig: |
| 44 | + interfaces: |
| 45 | + - name: enp1s0 <1> |
| 46 | + type: interface |
| 47 | + state: up |
| 48 | + ipv4: |
| 49 | + dhcp: true |
| 50 | + enabled: true |
| 51 | + ipv6: |
| 52 | + enabled: false |
| 53 | + - name: enp2s0 <2> |
| 54 | + type: interface |
| 55 | + state: up |
| 56 | + ipv4: |
| 57 | + dhcp: true |
| 58 | + enabled: true |
| 59 | + ipv6: |
| 60 | + enabled: false |
| 61 | + - name: enp3s0 <3> |
| 62 | + type: interface |
| 63 | + state: up |
| 64 | + ipv4: |
| 65 | + enabled: false |
| 66 | + ipv6: |
| 67 | + enabled: false |
| 68 | +# ... |
| 69 | +---- |
| 70 | +<1> The interface for the provisioned network interface card (NIC). |
| 71 | +<2> The first bonded interface that pulls in the Ignition config file for the bond interface. |
| 72 | +<3> The second bonded interface is part of a minimal configuration that pulls ignition during cluster installation. |
| 73 | + |
| 74 | +. Define each network interface in a `MachineConfig` manifest file: |
| 75 | ++ |
| 76 | +.Example `MachineConfig` manifest file that defines multiple network interfaces |
| 77 | +[source,yaml] |
| 78 | +---- |
| 79 | +# ... |
| 80 | +ovn: |
| 81 | + bridge-mappings: |
| 82 | + - localnet: localnet-network |
| 83 | + bridge: br-ex |
| 84 | + state: present |
| 85 | +interfaces: |
| 86 | + - name: br-ex |
| 87 | + type: ovs-bridge |
| 88 | + state: up |
| 89 | + ipv4: |
| 90 | + enabled: false |
| 91 | + dhcp: false |
| 92 | + ipv6: |
| 93 | + enabled: false |
| 94 | + dhcp: false |
| 95 | + bridge: |
| 96 | + allow-extra-patch-ports: true |
| 97 | + port: |
| 98 | + - name: br-ex |
| 99 | + - name: patch-ex-to-phy |
| 100 | + ovs-db: |
| 101 | + external_ids: |
| 102 | + bridge-uplink: "patch-ex-to-phy" |
| 103 | + - name: br-ex |
| 104 | + type: ovs-interface |
| 105 | + state: up |
| 106 | + copy-mac-from: enp2s0 |
| 107 | + ipv4: |
| 108 | + enabled: true |
| 109 | + dhcp: true |
| 110 | + auto-route-metric: 48 |
| 111 | + ipv6: |
| 112 | + enabled: false |
| 113 | + dhcp: false |
| 114 | + - name: br-phy |
| 115 | + type: ovs-bridge |
| 116 | + state: up |
| 117 | + ipv4: |
| 118 | + enabled: false |
| 119 | + dhcp: false |
| 120 | + ipv6: |
| 121 | + enabled: false |
| 122 | + dhcp: false |
| 123 | + bridge: |
| 124 | + allow-extra-patch-ports: true |
| 125 | + port: |
| 126 | + - name: patch-phy-to-ex |
| 127 | + - name: ovs-bond |
| 128 | + link-aggregation: |
| 129 | + mode: balance-slb |
| 130 | + port: |
| 131 | + - name: enp2s0 |
| 132 | + - name: enp3s0 |
| 133 | + - name: patch-ex-to-phy |
| 134 | + type: ovs-interface |
| 135 | + state: up |
| 136 | + patch: |
| 137 | + peer: patch-phy-to-ex |
| 138 | + - name: patch-phy-to-ex |
| 139 | + type: ovs-interface |
| 140 | + state: up |
| 141 | + patch: |
| 142 | + peer: patch-ex-to-phy |
| 143 | +# ... |
| 144 | +---- |
| 145 | + |
| 146 | +. Use the `cat` command to base64-encode the interface content of the `MachineConfig` manifest file: |
| 147 | ++ |
| 148 | +[source,terminal] |
| 149 | +---- |
| 150 | +$ cat machineconfig.yaml | base64 -w0 <1> |
| 151 | +---- |
| 152 | +<1> Where the `-w0` option prevents line wrapping during the base64 encoding operation. |
| 153 | + |
| 154 | +. Create `MachineConfig` manifest files for the `master` role and the `worker` role. The following example manifest file configures the `master` role for all nodes that exist in a cluster. You can also create a manifest file for `master` and `worker` roles specific to a node. |
| 155 | ++ |
| 156 | +[source,yaml] |
| 157 | +---- |
| 158 | +apiVersion: machineconfiguration.openshift.io/v1 |
| 159 | +kind: MachineConfig |
| 160 | +metadata: |
| 161 | + labels: |
| 162 | + machineconfiguration.openshift.io/role: master |
| 163 | + name: 10-br-ex-master <1> |
| 164 | +spec: |
| 165 | + config: |
| 166 | + ignition: |
| 167 | + version: 3.2.0 |
| 168 | + storage: |
| 169 | + files: |
| 170 | + - contents: |
| 171 | + source: data:text/plain;charset=utf-8;base64,<base64_encoded_nmstate_configuration> <2> |
| 172 | + mode: 0644 |
| 173 | + overwrite: true |
| 174 | + path: /etc/nmstate/openshift/cluster.yml <3> |
| 175 | +---- |
| 176 | +<1> The name of the policy. |
| 177 | +<2> Writes the encoded base64 information to the specified path. |
| 178 | +<3> Specify the path to the `cluster.yml` file. For each node in your cluster, you can specify the short hostname path to your node, such as `<node_short_hostname>`.yml. |
| 179 | + |
| 180 | +. Save the `MachineConfig` manifest file to the `./<installation_directory>/manifests` directory, where `<installation_directory>` is the directory in which the installation program creates files. |
| 181 | + |
0 commit comments