Rate This Document
Findability
Accuracy
Completeness
Readability

Installing Kube-OVN 1.2.1

You are advised to deploy the Kube-OVN network plugin through one-click installation. For details, see Kube-OVN User Guide. This document uses Kube-OVN 1.2.1 as an example. Perform the following steps to download, configure, and install the Kube-OVN network plugin.

  1. Download the install.sh file of Kube-OVN 1.2.1.
    1
    wget https://raw.githubusercontent.com/alauda/kube-ovn/release-1.2/dist/images/install.sh --no-check-certificate
    
  2. Change the values of the following parameters in the install.sh file as required: VERSION, POD_CIDR, and IFACE.

    The following describes how to change the values of the preceding three parameters:

    • This document uses the deployment of components on the Kunpeng ARM platform as an example. You need to add -arm after the value of the VERSION parameter. That is, change VERSION="v1.2.1" to VERSION="v1.2.1-arm".
    • The value of POD_CIDR is set to 10.16.0.0/16 by default.
    • If you need to specify the physical network port used by the Kube-OVN, change the value of the IFACE parameter to the specified network port name. The primary node and compute nodes must have network ports with the same name and place the ports in the same network segment before they can be added to the Kube-OVN network of the K8s cluster. For details, see the reference of the IFACE parameter in the install.sh script downloaded in 1.

      If the physical machine has multiple NICs and the value of the IFACE parameter in install.sh is empty, Kube-OVN uses the network port corresponding to the default route. In this document, Kube-OVN uses the network port of the 10GE NIC. You need to set the value of the IFACE parameter in install.sh to the network port name of the 10GE NIC, for example, enp3s0. The 10GE NICs of the primary node and compute nodes must have the network port named enp3s0. If enp3s0 does not exist, change the network port name by running the following commands:

      1
      2
      3
      ip link set dev enp8s0 down
      ip link set enp8s0 name enp3s0
      ip link set dev enp3s0 up
      

      If you want the new network port name to be valid after you restart the system, perform the following operations:

      • Stop and disable the NetworkManager.
        1
        2
        systemctl stop NetworkManager
        systemctl disable NetworkManager
        
      • Modify the grub configuration file.
        1. Open the /etc/sysconfig/grub file.
          1
          vim /etc/sysconfig/grub
          
        2. The original content of the file is as follows in this document:
          GRUB_TIMEOUT=5
          GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)"
          GRUB_DEFAULT=saved
          GRUB_DISABLE_SUBMENU=true
          GRUB_TERMINAL_OUTPUT="console"
          GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet"
          GRUB_DISABLE_RECOVERY="true"
        3. Press i to enter the insert mode and add net.ifnames=0 biosdevname=0 to the end of the GRUB_CMDLINE_LINUX parameter.
          GRUB_CMDLINE_LINUX="crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet  net.ifnames=0 biosdevname=0"
        4. Press Esc, type :wq!, and press Enter to save the file and exit.
      • Test the modification and make the modification take effect.
        1
        grub2-mkconfig
        

        If no error is reported, make the configuration take effect.

        1
        grub2-mkconfig -o /boot/grub2/grub.cfg
        
      • Rename the network port configuration file.
        1
        2
        cd /etc/sysconfig/network-scripts
        mv ifcfg-enp8s0 ifcfg-enp3s0
        
      • Modify the network port configuration file.
        1. Open the ifcfg-enp3s0 file.
          1
          vim ifcfg-enp3s0
          
        2. Press i to enter the insert mode and change the values of NAME and DEVICE to enp3s0.
        3. Press Esc, type :wq!, and press Enter to save the file and exit.
      • Add a naming rule.
        1. Open or create a naming rule file.
          1
          vim /etc/udev/rules.d/70-persistent-net.rules
          
        2. Press i to enter the insert mode and add the following rule to the end of the file:
          SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*",ATTR{address}=="f4:79:60:82:09:ab",ATTR{type}=="1" ,KERNEL=="enp*",NAME="enp3s0"

          The MAC address after ATTR{address} must be the same as that of enp8s0. You can run the ifconfig command to view the MAC address.

        3. Press Esc, type :wq!, and press Enter to save the file and exit.
      • Restart the server for the configurations to take effect.
        1
        reboot -f
        
  3. Install Kube-OVN.
    bash install.sh
  • If Kube-OVN fails to be installed or needs to be reinstalled, uninstall it by referring to Uninstalling Kube-OVN 1.2.1 and then reinstall it by referring to Installing Kube-OVN 1.2.1.
  • Ensure that the drivers of all the NICs to be used have been installed.
  • You are advised to install Kube-OVN on the primary node after the primary node is initialized, and then join other compute nodes in the cluster of the primary node.