Build the PorterLB Project

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

Prerequisites

Procedure

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

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

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

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

    1. 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:

    1. 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:

    1. 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:

    1. make release

    NOTE

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

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

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

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

    1. kubectl apply -f deploy/release.yaml

Last modified March 25, 2021: Written porterlb-chinese-documentation-style-guide. (a90de3a)