Installing License Service without Operator Lifecycle Manager (OLM)

Learn how to install License Service without the Operator Lifecycle Manager (OLM).

Complete the following procedure to install License Service on a system that does not have the Operator Lifecycle Manager (OLM) deployed.

Prerequisites

Complete the installation on a host that meets the following criteria:

  • Linux or macOS operating system (or Windows with Linux Bash Shell, for example from WSL).
  • Docker and Kubernetes CLI installed.
  • Access to your cluster with Kubernetes config.
  • Access to the following sites and ports:
    • *.icr.io:443 for IBM Cloud Container Registry and License Service catalog source.
    • github.com for tools.

See Supported platforms and hardware requirements before you install License Service to check the installation requirements.

Verifying if License Service is already installed on the cluster

Check if License Service is already installed on the cluster to prevent the use of multiple License Service copies to report the license usage of multiple IBM Cloud Paks that are running on the same cluster.

Important: If you install multiple instances of License Service on one cluster, License Service generates an incorrect license usage report.

To check if License Service is already installed on the cluster, run the following command:

kubectl get deployment --all-namespaces | grep ibm-licensing-operator
  • If you get a deployment in response, License Service is already installed on the cluster. Upgrade to the latest version to benefit from all newest features and improvements. For more information, see Backing up and upgrading License Service.

  • If you get no deployments in response, proceed with the installation of License Service.

Installation

Complete the following steps to create the required resources.

  1. Run the following command to create the ibm-licensing namespace for installing the operator.

    export licensing_namespace=ibm-licensing
    kubectl create namespace ${licensing_namespace}
    

    See the following notes:

    Note: The recommended namespace for License Service installation is ibm-licensing. The commands in the installation instructions contain this default namespace. However, you can install License Service in any other custom namespace. If you install License Service in a custom namespace, replace ibm-licensing with the name of the custom namespace.

  2. Set the context to create the resources.

    • For Kubernetes:

      current_context=$(kubectl config current-context)
      kubectl config set-context ${current_context} --namespace=${licensing_namespace}
      
    • For OpenShift Container Platform:

      oc project ${licensing_namespace}
      
  3. Use git clone.

    export operator_release_version=latest-4.x
    git clone -b ${operator_release_version} https://github.com/IBM/ibm-licensing-operator.git
    cd ibm-licensing-operator/
    
  4. Switch namespaces in role-based access control (RBAC) if you need to install License Service in a different namespace than ibm-licensing:

    • For LINUX users:

      if [ "${licensing_namespace}" != "" ] && [ "${licensing_namespace}" != "ibm-licensing" ]; then
        sed -i 's|namespace: ibm-licensing|namespace: '"${licensing_namespace}"'|g' config/rbac/*.yaml
      fi
      
    • For MAC users:

      if [ "${licensing_namespace}" != "" ] && [ "${licensing_namespace}" != "ibm-licensing" ]; then
        sed -i '' 's|namespace: ibm-licensing|namespace: '"${licensing_namespace}"'|g' config/rbac/*.yaml
      fi
      
  5. Apply RBAC roles and custom resource definition (CRD):

    # To add CRD:
    kubectl apply -f config/crd/bases/operator.ibm.com_ibmlicensings.yaml
    kubectl apply -f config/crd/bases/operator.ibm.com_ibmlicensingmetadatas.yaml
    kubectl apply -f config/crd/bases/operator.ibm.com_ibmlicensingdefinitions.yaml
    kubectl apply -f config/crd/bases/operator.ibm.com_ibmlicensingquerysources.yaml
    # To add RBAC:
    kubectl apply -f config/rbac/role.yaml
    kubectl apply -f config/rbac/role_operands.yaml
    kubectl apply -f config/rbac/service_account.yaml
    kubectl apply -f config/rbac/role_binding.yaml
    
  6. Modify the operator.yaml image based on tags.

    • For Linux:

      sed -i "s/annotations\['olm.targetNamespaces'\]/namespace/g" config/manager/manager.yaml
      kubectl apply -f config/manager/manager.yaml
      
    • For MAC:

      sed -i "" "s/annotations\['olm.targetNamespaces'\]/namespace/g" config/manager/manager.yaml
      kubectl apply -f config/manager/manager.yaml
      

    The Operator for IBM License Service is created and only responsible for watching over the configuration and managing resources of the IBM License Service.

  7. Update the License Service instance that was created during installation to accept the license.

    1. Create the accept-license.yaml file with the following content:

      spec:
        license:
          accept: true
      
    2. Run the following command:

      kubectl patch IBMLicensing instance --type merge --patch-file accept-license.yaml
      
  8. This step is required only if you installed License Service on Kubernetes, for example IBM Cloud Kubernetes Services (IKS) or Amazon Elastic Kubernetes Service (EKS). Configure ingress before you proceed to verification. For detailed instructions, see Configuring ingress.

    If you installed License Service on OpenShift Container Platform, you do not need to configure Ingress. Proceed to verification.

Verification

To check whether License Service components are properly installed and running, see Checking License Service components.