Build the OpenELB Project

This document describes how to build the OpenELB project for testing.

Prerequisites

Procedure

  1. Visit https://github.com/kubesphere/OpenELB and click Fork to fork the OpenELB repository to your own GitHub account.

  2. Log in to your environment, and run the following commands to clone the OpenELB repository and go to the openelb directory:

    git clone <Address of your own OpenELB repository>
    
    cd openelb
    
  3. Run the following command to install Kustomize and Kubebuilder:

    ./hack/install_tools.sh
    
  4. Run the following command to install controller-gen:

    go get sigs.k8s.io/controller-tools/cmd/controller-gen@v0.4.0
    
  5. Run the following command to configure the environment variable for controller-gen:

    export PATH=/root/go/bin/:$PATH
    

    NOTE

    You need to change /root/go/bin/ to the actual path of controller-gen.
  6. Run the following command to generate CRDs and webhooks:

    make generate
    
  7. Customize the values of IMG_MANAGER and IMG_AGENT in Makefile and run the following command to generate a YAML release file in the deploy directory:

    make release
    

    NOTE

    • IMG_MANAGER specifies the repository and tag of the openelb-manager image.

    • IMG_AGENT specifies the repository and tag of the openelb-agent image.

    • Currently, OpenELB uses only the openelb-manager image. The openelb-agent image will be used in future versions.

  8. Run the following command to deploy OpenELB as a plugin:

    kubectl apply -f deploy/release.yaml