26. 07. 2024 Alessandro Valentini DevOps

Bonding Configuration While Adding an OpenShift Node

When you prepare a machine for production, you usually want to use a redundant network interface in order to be resilient to possible network outages.

When we created our OpenShift cluster this wasn’t possible during the installation procedure, at least not using the UPI procedure. We recently added a new node and discovered this new option which allows you to specify complex network configurations during the installation phase.

You just need to select the Static IP, bridges, and bonds option while adding a node, and then in the next step you’ll be asked to specify a Static network configuration. The Form View allows only very basic configurations like static IP, but for more advanced configurations you need to select the YAML view — and here the fun begins: the YAML must be written using the Nmstate syntax.

Nmstate is a declarative network manager for Linux hosts, providing a command-line interface and API to configure and manage network settings. Nmstate integrates through the Kubernetes NMState Operator, allowing users to manage and automate network configurations on cluster nodes. This integration simplifies network management within Kubernetes environments, ensuring consistent and reproducible network configurations across the cluster.

In our case we want to tell the new node to use two of its interfaces and retrieve the IP via DHCP. On the switch side, the two ports don’t have any special configuration like LACP.

interfaces:
  - name: bond0
    type: bond
    state: up
    mac-address: D4:04:...
    ipv4:
      dhcp: true
      enabled: true
    link-aggregation:
      mode: balance-rr
      options:
        miimon: '140'
      port:
      - eth1
      - eth2

In the example above you’re creating a new interface of type bond,with the ipv4 address being provided via DHCP, and then in the link-aggregation section you specify which interfaces to aggregate.

The two ports to be used are defined in the bottom form, and have to match your machine’s MAC addresses:

You can find some examples very similar to ours, but please note that, during the installation phase, you don’t have to specify the API version, metadata or other parameters. Furthermore, a problem we found with respect to the example in the link is that the copy-mac-from option unfortunately is not accepted by the Cluster Manager, and the only workaround was to specify a MAC address identical to one of the two NICs.

If everything worked properly you’ll see the bond plus the two NICs in the Cluster Manager once you boot with the generated ISO, before starting the installation.

In conclusion, configuring bonding while creating an OpenShift cluster is not too difficult provided that you familiarize yourself a bit with Nmstate. Unfortunately, the OpenShift documentation itself does not provides any examples.

These Solutions are Engineered by Humans

Did you find this article interesting? Are you an “under the hood” kind of person? We’re really big on automation and we’re always looking for people in a similar vein to fill roles like this one as well as other roles here at Würth Phoenix.

Alessandro Valentini

Alessandro Valentini

DevOps Engineer at Wuerth Phoenix
DevOps Engineer at Würth Phoenix

Author

Alessandro Valentini

DevOps Engineer at Würth Phoenix

Leave a Reply

Your email address will not be published. Required fields are marked *

Archive