Install OpenELB on Kubernetes

This document describes how to use kubectl and Helm to install and delete OpenELB in a Kubernetes cluster.

NOTE

  • In a Kubernetes cluster, you only need to install OpenELB once. After the installation is complete, an openelb-controller Deployment containing an openelb-controller Pod and an openelb-speaker DaemonSet containing openelb-speaker Pods will be installed in the cluster. The openelb-controller Pod is used to implement the IPAM for service load balancer IPs, while the openelb-speaker Pods are used to announce the service load balancer IPs.

  • After the installation is complete, you can set node selectors to ensure that the load traffic runs on specific nodes. For details, see Configure Multiple OpenELB Replicas.

Prerequisites

  • You need to prepare a Kubernetes cluster, and ensure that the Kubernetes version is 1.15 or later. OpenELB requires CustomResourceDefinition (CRD) v1, which is only supported by Kubernetes 1.15 or later. You can use the following methods to deploy a Kubernetes cluster:

    OpenELB is designed to be used in bare-metal Kubernetes environments. However, you can also use a cloud-based Kubernetes cluster for learning and testing.

    • If you use Helm to install OpenELB, ensure that the Helm version is Helm 3.

Install OpenELB Using kubectl

  1. Log in to the Kubernetes cluster over SSH and run the following command:

    We recommend using the stable release version in a production environment. Please use the following command to download the installation script for the stable version:

    wget https://raw.githubusercontent.com/openelb/openelb/release-0.6/deploy/openelb.yaml
    kubectl apply -f openelb.yaml
    

    If you are interested in the latest features of the master branch and want to use the development version, use the following command to download the deployment script:

    wget https://raw.githubusercontent.com/openelb/openelb/master/deploy/openelb.yaml
    kubectl apply -f openelb.yaml
    
  2. Run the following command to check whether the status of openelb-controller and openelb-speaker is READY: 1/1 and STATUS: Running. If yes, OpenELB has been installed successfully.

    kubectl get po -n openelb-system
    

    The following is an example of the expected command output:

    NAME                                  READY   STATUS      RESTARTS   AGE
    openelb-admission-create-fv8jb        0/1     Completed   0          41s
    openelb-admission-patch-887qh         0/1     Completed   0          41s
    openelb-controller-6d59c894c9-jgfks   1/1     Running     0          41s
    openelb-speaker-dnkcr                 1/1     Running     0          41s
    openelb-speaker-fmkxb                 1/1     Running     0          41s
    openelb-speaker-trh6p                 1/1     Running     0          41s
    ... ...
    

Delete OpenELB Using kubectl

  1. To delete OpenELB, log in to the Kubernetes cluster and run the following command:

    kubectl delete -f openelb.yaml
    

    NOTE

    Before deleting OpenELB, you should first delete all Services that use OpenELB.
  2. Run the following command to check the result. If the openelb-system namespace does not exist, OpenELB has been deleted successfully.

    kubectl get ns
    

Install OpenELB Using Helm

  1. Log in to the Kubernetes cluster over SSH and run the following commands:

    helm repo add openelb https://openelb.github.io/openelb
    helm repo update
    helm install openelb openelb/openelb -n openelb-system --create-namespace
    
  2. Run the following command to check whether the status of openelb-controller and openelb-speaker is READY: 1/1 and STATUS: Running. If yes, OpenELB has been installed successfully.

    kubectl get po -n openelb-system
    

    The following is an example of the expected command output:

    NAME                                  READY   STATUS      RESTARTS   AGE
    openelb-admission-create-fv8jb        0/1     Completed   0          41s
    openelb-admission-patch-887qh         0/1     Completed   0          41s
    openelb-controller-6d59c894c9-jgfks   1/1     Running     0          41s
    openelb-speaker-dnkcr                 1/1     Running     0          41s
    openelb-speaker-fmkxb                 1/1     Running     0          41s
    openelb-speaker-trh6p                 1/1     Running     0          41s
    ... ...
    

Delete OpenELB Using Helm

  1. To delete OpenELB, run the following command:

    helm delete openelb -n openelb-system
    

    NOTE

    Before deleting OpenELB, you should first delete all Services that use OpenELB.
  2. Run the following command to check the result. If the OpenELB application does not exist, OpenELB has been deleted successfully.

    helm ls -n openelb-system
    

Last modified June 14, 2024: update install openelb by helm (63c2abd)