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:

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

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:

    • The ibm-licensing namespace is the default namespace of License Service. If you need to install License Service in a custom namespace for your cluster, replace ibm-licensing with your custom namespace.

    • For OpenShift cluster, check whether License Service is installed in cs-control or ibm-common-services namespace of the cluster to prevent the multiple License Service instance. If License Service is installed, you can upgrade License Service to the latest version. If you install multiple License Service in the same namespace, an incorrect license usage report is generated.

  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.