Installing License Service on OpenShift Container Platform

Learn how to install the License Service on OpenShift Container Platform.

Prerequisites

  • A cluster with the supported OpenShift Container Platform version. License Service is supported on the supported OpenShift Container Platform versions that are in full, maintenance, and extended support life cycle phase. For more information, see Red Hat OpenShift Container Platform Life Cycle Policy in Red Hat OpenShift documentation.
  • Administrator permissions for the OpenShift cluster.
  • Access to the OpenShift console.

Before installation, see Supported platforms and hardware requirements to check the installation requirements.

Verifying the installation of License Service in OpenShift cluster

For the OpenShift cluster, check whether the License Service is installed in cs-control or ibm-common-services namespace of the cluster to prevent the use of the multiple License Service copies to report the license usage of multiple IBM Cloud Paks that are running on the same cluster.

You can verify the installation of License Service in cs-control or ibm-common-services namespace with one of the following methods:

  • To verify the installation of License Service with OpenShift console, complete the following steps:

    1. Go to Operators > Installed Operators.

    2. Select your project from the Project drop-down list.

    3. Search for the IBM Licensing name in the Installed Operators page. The Installed Operators displays the installed License Service.

    4. Check whether the cs-control or ibm-common-services namespace is displayed in the Namespace section.

      Note: If the License Service is installed in cs-control or ibm-common-services namespace and multiple IBM Cloud Paks run on the same cluster, upgrade the License Service to the latest version. For more information, see Upgrading foundational services.

      If a single instance of IBM Cloud Pak runs on the cluster, you can install the License Service in the ibm-licensing namespace.

    5. If the Installed Operators page displays No Operators found, install the License Service with one of the following methods:

  • To verify the installation of License Service with CLI, run the following command:

    oc get csv -n ibm-common-services | grep ibm-licensing-operator
    
    oc get csv -n cs-control | grep ibm-licensing-operator
    

    If the output is displayed, the License Service is installed in cs-control or ibm-common-services namespace.

    Note: If the License Service is installed in cs-control or ibm-common-services namespace and multiple IBM Cloud Paks run on the same cluster, upgrade the License Service to the latest version. For more information, see Upgrading foundational services.

    If a single instance of IBM Cloud Pak runs on the cluster, you can install the License Service in the ibm-licensing namespace.

    If the output is not displayed, install the License Service with one of the following methods:

Installing License Service

You can install License Service with OpenShift console or with CLI. Choose one of the following procedures to complete the installation with your preffered method.

Installing License Service with OpenShift console

  1. Create the CatalogSource to get the operator bundles.

    1. Log in to the OpenShift console.

    2. Click the plus icon on the header.

    3. Copy the following CatalogSource into the editor.

    apiVersion: operators.coreos.com/v1alpha1
    kind: CatalogSource
    metadata:
      name: ibm-licensing-catalog
      namespace: openshift-marketplace
    spec:
      displayName: IBM License Service Catalog
      publisher: IBM
      sourceType: grpc
      image: icr.io/cpopen/ibm-licensing-catalog
      updateStrategy:
       registryPoll:
        interval: 45m
    
    1. Click Create.
  2. Create the ibm-licensing namespace.

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

    1. Go to Operators > Operator Hub.

    2. Expand the list of Projects.

    3. Select Create Project.

    4. Enter ibm-licensing as a name and click Create.

    The image shows how to create the ibm-licensing namespace.

  3. Install the IBM Licensing package in OperatorHub.

    1. Go to OperatorHub and search for the IBM Licensing operator.

    Note: It might take a few minutes to display the operator in the OperatorHub. If the operator is not displayed in the OperatorHub, there is an issue with the CatalogSource.

    1. Select IBM Licensing and click Install.

      The image shows the IBM Licensing installation window.

    2. Set the Update Channel to the v4.2 version.

    3. Set the Installation mode to A specific namespace on the cluster.

    4. Set the Installed Namespace to Select a Namespace, and select the ibm-licensing namespace.

    5. Set Update approval to Automatic.

    6. Click Install.

  4. Verify that the installation is successful.

    To check whether the installation is successful, wait for about 1 minute, and go to Installed operators. You can see IBM Licensing in the Succeeded status.

    The image shows the status of correctly installed IBM Licensing operator

    The IBM Licensing operator is installed for the License Service. The operator is only responsible for watching over the configuration and managing resources of IBM Licensing.

  5. Configure the IBM Licensing instance if required. For more information, see Configuring License Service.

  6. Check whether the pod is created and has Running status. It might take a few minutes.

    To view the logs, go to Workloads > Pods and, search for ibm-licensing-service-instance in the ibm-licensing project. For more information, click ibm-licensing-service-instance and check its logs and events.

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

    1. Go to Operators > Installed Operators.

    2. From the Project drop-down list, select All Projects

    3. Select IBM Licensing Operator.

    4. Select the IBM License Service tab. The instance of License Service custom resource is listed.

    5. From the overflow action menu, select Edit IBMLicensing.

      The image shows the IBM License Service tab where the instance is listed.

    6. Edit the YAML and add the following lines under spec section.

      spec:
        license:
          accept: true
      

      The image shows the License Service instance YAML with the license parameter.

    7. Click Save.

The installation of License Service is completed and running in your cluster.

Installing License Service with CLI

  1. Log in to the cluster by using the oc login command.

  2. Create the License Service catalog source:

    1. Create a YAML file named license-service-catalog.yaml with the following definition:

      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: ibm-licensing-catalog
        namespace: openshift-marketplace
      spec:
        displayName: IBM License Service Catalog
        publisher: IBM
        sourceType: grpc
        image: icr.io/cpopen/ibm-licensing-catalog
        updateStrategy:
         registryPoll:
          interval: 45m
      
    2. Apply the YAML file to create the License Service catalog source.

      oc apply -f license-service-catalog.yaml
      
    3. Verify that the CatalogSource for your IBM License Service operator is created.

      oc get pods -n openshift-marketplace
      oc get catalogsource -n openshift-marketplace
      
  3. Install the IBM License Service operator.

    1. Create a namespace for License Service.

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

      export NAMESPACE=ibm-licensing
      
      oc create namespace $NAMESPACE
      
    2. Create the operator group to deploy the OperatorGroup resource.

      cat <<EOF | oc apply -f -
      apiVersion: operators.coreos.com/v1
      kind: OperatorGroup
      metadata:
        name: licensing-og
        namespace: ibm-licensing
      spec:
        targetNamespaces:
        - ibm-licensing
      EOF
      
    3. Create the subscription for License Service.

      export LS_CHANNEL=v4.2  
      
      cat <<EOF | oc apply -f -
      apiVersion: operators.coreos.com/v1alpha1
      kind: Subscription
      metadata:
        name: ibm-licensing-operator-app
        namespace: ibm-licensing
      spec:
        channel: $LS_CHANNEL
        installPlanApproval: Automatic
        name: ibm-licensing-operator-app
        source: ibm-licensing-catalog
        sourceNamespace: openshift-marketplace
      EOF
      
  4. Verify that your IBM License Service operator is installed:

    oc get pod -n $NAMESPACE
    

    It might take up to 15 minutes for all the pods to show the Running status.

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

      oc patch IBMLicensing instance --type merge --patch-file accept-license.yaml
      

Verification

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