Rate This Document
Findability
Accuracy
Completeness
Readability

Manual Installation

Prerequisites

  • The Docker and Kubernetes components (kubeadm, kubectl, and kubelet) have been installed on the node to be deployed.
  • The node to be deployed can properly pull Docker images.

Procedure

  1. Set the master Kubernetes nodes during initialization.

    In this section, the 10.16.0.0/16 network segment is used as the network driver classless CIDR and the default gateway is used as the network broadcast address. If you need to specify another network segment, modify the commands accordingly.

    1
    2
    3
    4
    kubeadm init --pod-network-cidr=10.16.0.0/16
    mkdir -p $HOME/.kube
    cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
    chown $(id -u):$(id -g) $HOME/.kube/config
    

    After the initialization is complete, information in Figure 1 and Figure 2 are displayed. Check whether the pod information of the Kubernetes cluster is normal and whether the node status is NotReady. Back up the kubeadm join command in the output for future use. Then, deploy the network plane.

    Figure 1 Successful initialization of the master Kubernetes nodes
    Figure 2 Initialization status of the master Kubernetes nodes
  2. Deploy custom resource definition (CRD) resources.

    Kube-OVN creates three types of CRD resources, that is, subnets, IP addresses, and VLANs, to facilitate network management. Create the crd.yaml file by referring to YAML File for CRD Deployment. Then, run the kubectl command to create CRD resources.

    1
    kubectl apply -f crd.yaml
    

    After the execution is complete, run the kubectl get crd command to view the result, as shown in Figure 3.

    Figure 3 Successful deployment of CRD resources
  3. Label the node where the ovndb resides.

    Specify the master OVN node for Kube-OVN to deploy the ovndb for storing data persistently on the hard drive of the host machine.

    1
    kubectl label node <node-name to deploy ovndb> kube-ovn/role=master
    

    After specifying the master OVN node, you can run the kubectl get node --show-labels command to view the label.

    Figure 4 Node labels
  4. Deploy the OVN.

    The underlying network of Kube-OVN depends on the OVS and OVN provided by the Open vSwitch community. Create the ovn.yaml file by referring to YAML File for OVN Deployment. Then, run the kubectl command to deploy the OVS and OVN.

    1
    kubectl apply -f ovn.yaml
    

    After the execution is complete, run the kubectl get pods -A command to view pod status. The information shown in Figure 5 is displayed.

    Figure 5 Successful deployment of the OVN
  5. Deploy the Kube-OVN-Controller and CNI Server.

    By default, Kube-OVN uses 10.16.0.0/16 as the default subnet. 100.64.0.1/16 is used as the subnet for communication between hosts and pods, the master NIC of Kubernetes nodes is used for pod traffic, and the traffic mirroring mode is enabled. Before the deployment, obtain and edit the kube-ovn.yaml file by referring to YAML File for Kube-OVN Deployment. Then, run the kubectl command to deploy Kube-OVN.

    1
    kubectl apply -f kube-ovn.yaml
    

    After the execution is complete, run the kubectl get pods -A command to view pod status, and run the kubectl get subnet command to view subnets automatically created. The information shown in Figure 6 is displayed.

    Figure 6 Successful deployment of Kube-OVN
  6. Install the kubectl plugin.

    Kube-OVN provides the kubectl plugin for better monitoring network quality and diagnosing faults. You are advised to install the plugin.

    Save the code provided in kubectl Plugin as the kubectl-ko file. Then, copy the file to a directory (for example, /usr/local/bin) in $PATH, and grant the execute permission on the file.

    1
    2
    cp kubectl-ko /usr/local/bin/kubectl-ko
    chmod +x /usr/local/bin/kubectl-ko
    

    After the execution is complete, run the kubectl command to check the plugin status.

    1
    kubectl plugin list
    

    The command output is as follows:

  7. Add nodes to the cluster.

    On other Kubernetes nodes to be deployed, run the kubeadm join command backed up in 1 to add the nodes to be deployed to the Kubernetes cluster.

    1
    2
    kubeadm join <master-ip:port> --token <your-token> \
    --discovery-token-ca-cert-hash sha256:<your-sha256-ca>
    

    After the cluster nodes are added, "This node has joined the cluster" is displayed, as shown in Figure 7. The Kube-OVN networking procedure is complete.

    Figure 7 Successful adding of cluster nodes