License Service installation: Red Hat OpenShift

IBM® License Service can be installed manually on the Red Hat OpenShift Container Platform.

Prerequisites

  • Turbonomic version 8.9.3 or later.

  • Prometheus is enabled in the cr.yaml file.

    The prometheus-server pod in the turbonomic namespace is required since it is used by License Service to pull metrics. If you do not have Prometheus enabled, set the prometheus: enabled parameter to true in your cr.yaml file as shown in the example.

    prometheus:
     enabled: true
  • A cluster with Red Hat OpenShift Container Platform version 4.6 or higher.

  • Administrator permissions for the Red Hat OpenShift cluster.

  • Access to the Red Hat OpenShift console.

Installing License Service

  1. Create the CatalogSource to get the operator bundles.

    1. Log in to the Red Hat OpenShift console.

    2. Click the + (plus) button on the header.

    3. Copy the following CatalogSource into the editor.
      apiVersion: operators.coreos.com/v1alpha1
      kind: CatalogSource
      metadata:
        name: opencloud-operators
        namespace: openshift-marketplace
      spec:
        displayName: IBMCS Operators
        publisher: IBM
        sourceType: grpc
        image: icr.io/cpopen/ibm-operator-catalog
        updateStrategy:
         registryPoll:
          interval: 45m
    4. Click Create.

  2. Create the ibm-common-services namespace.

    1. Navigate to Home > Projects.

    2. On the Projects page, click Create Project.

    3. Enter ibm-common-services as the name of the project and click Create.

  3. Install the IBM Licensing package.

    The IBM Licensing Operator that you create is only responsible for watching over the configuration and managing resources that are used by IBM Licensing.

    1. Navigate to Operators > OperatorHub.

    2. In the Filter by keyword box, enter IBM Licensing to find and select the IBM Licensing Operator.

      Note:

      It might take a few minutes for the operator to appear. If the operator does not appear, an issue exists with the CatalogSource.

    3. On the IBM Licensing Operator page, click Install.

    4. On the Install Operator page, specify the Update channel, the project (namespace) in which you want to deploy the Operator, and the wanted Update approval strategy.

      • Set Update Channel to v3.

      • As an Installation Mode select A specific namespace on the cluster, and set it to the ibm-common-services namespace that you created in the previous step.

      • Set Update approval strategy to Automatic.

    5. Click Install.

  4. Verify that the installation is successful.

    After the Operator installs and you see "Installed operator - ready for use," click View Operator or select Operators > Installed Operators to view the IBM Licensing Operator. IBM Licensing is now in the Succeeded status.

Option 1: Creating IBM Licensing instances

Follow the steps to create the instances by using the Red Hat OpenShift console, or refer to the next section if you prefer to create instances by using the command line.

Note:

The instance can be accessed at any time during or after configuration by navigating to Administration > Custom Resource Definitions, and select IBM Licensing > Instances > Edit IBMLicensing.

  1. Navigate to the Installed Operators > IBM Licensing > IBM License Service tab.

  2. Create a file called IBMLicensing.

    Click Create IBMLicensing, then select the YAML view to display the Custom Resource YAML editor. Replace the contents of the YAML view with the following YAML content then click Create. This file can be saved anywhere.

    Note:

    Replace <turbo_namespace> with the namespace where Turbonomic is installed.

    If you do not want to have a separate ingress created for License Service, set ingressEnabled to false because the ingress created for Turbonomic can be used to access License Service.

    apiVersion: operator.ibm.com/v1alpha1
    kind: IBMLicensing
    metadata:
      labels:
        app.kubernetes.io/instance: ibm-licensing-operator
        app.kubernetes.io/managed-by: ibm-licensing-operator
        app.kubernetes.io/name: ibm-licensing
      name: instance
    spec:
      apiSecretToken: ibm-licensing-token
      datasource: datacollector
      httpsEnable: true
      ingressEnabled: true
      envVariable:
        PROMETHEUS_QUERY_SOURCE_ENABLED: "true"
        thanos_url: "http://prometheus-server.<turbo_namespace>:9090/api/v1/query"
  3. Create a file called IBMLicensingQuerySource and add the following content. This file can be saved anywhere.

    apiVersion: operator.ibm.com/v1
    kind: IBMLicensingQuerySource
    metadata:
      name: querysource
    spec:
      aggregationPolicy: MAX
      query: "turbo_managed_workloads_count{}"
      annotations:
        cloudpakId: ""
        cloudpakMetric: ""
        cloudpakName: ""
        productCloudpakRatio: ""
        productID: "b40ccd47c8e64b9eb450c047d8abd614"
        productName: "IBM Turbonomic Application Resource Management"
        productMetric: "MANAGED_VIRTUAL_SERVER"
        productChargedContainers: "All"
  4. Check whether the pod is created and has a Running status.

    Navigate to Workloads > Pods to confirm both the operator and instance pods are running and ready. Search for licensing in the ibm-common-services project. This may take a few minutes.

    The output is similar to the following example:

    ibm-common-services   ibm-licensing-operator-5fb7fcfbfc-gcr7l           1/1     Running            0               2d22h
    ibm-common-services   ibm-licensing-service-instance-6d58c99977-qmplv   1/1     Running            0               2d22h

    To investigate further, click the name of the pod starting with ibm-licensing-service-instance and check the logs and events.

  5. Ensure the prometheus-server pod in the turbonomic namespace is also in running state, since it is used by the License Service to pull metrics. Run the following command:

    oc get pods -n turbonomic

    The output is similar to the following example:

    prometheus-server-6c6876d8f9-f9rhf               4/4     Running   4 (53m ago)   54m

Option 2: Creating IBM Licensing instances by using the terminal

If you prefer creating the instances by using the command line, run the following steps in terminal. If you created the licenses by using the Red Hat OpenShift console, you can skip this section.

  1. Open an SSH terminal session.

  2. Run the following command:

    Note:

    Replace <turbo_namespace> with the namespace where Turbonomic is installed.

    oc apply -f - <<EOF
    apiVersion: operator.ibm.com/v1alpha1
    kind: IBMLicensing
    metadata:
      labels:
        app.kubernetes.io/instance: ibm-licensing-operator
        app.kubernetes.io/managed-by: ibm-licensing-operator
        app.kubernetes.io/name: ibm-licensing
      name: instance
    spec:
      apiSecretToken: ibm-licensing-token
      datasource: datacollector
      httpsEnable: true
      ingressEnabled: true
      envVariable:
        PROMETHEUS_QUERY_SOURCE_ENABLED: "true"
        thanos_url: "http://prometheus-server.<turbo_namespace>:9090/api/v1/query"
    ---
    apiVersion: operator.ibm.com/v1
    kind: IBMLicensingQuerySource
    metadata:
      name: querysource
    spec:
      aggregationPolicy: MAX
      query: "turbo_managed_workloads_count{}"
      annotations:
        cloudpakId: ""
        cloudpakMetric: ""
        cloudpakName: ""
        productCloudpakRatio: ""
        productID: "b40ccd47c8e64b9eb450c047d8abd614"
        productName: "IBM Turbonomic Application Resource Management"
        productMetric: "MANAGED_VIRTUAL_SERVER"
        productChargedContainers: "All"
    EOF
  3. Check whether the pod is created and has a Running status.

    Navigate to Workloads > Pods to confirm both the operator and instance pods are running and ready. Search for licensing in the ibm-common-services project. This may take a few minutes.

    The output is similar to the following example:

    ibm-common-services   ibm-licensing-operator-5fb7fcfbfc-gcr7l           1/1     Running            0               2d22h
    ibm-common-services   ibm-licensing-service-instance-6d58c99977-qmplv   1/1     Running            0               2d22h

    To investigate further, click the name of the pod starting with ibm-licensing-service-instance and check the logs and events.

  4. Ensure the prometheus-server pod in the turbonomic namespace is also in running state, since it is used by the License Service to pull metrics. Run the following command:

    oc get pods -n turbonomic

    The output is similar to the following example:

    prometheus-server-6c6876d8f9-f9rhf               4/4     Running   4 (53m ago)   54m

Retrieving License Service data

You can use the License Service user interface (UI) in your browser to retrieve license usage data for monitoring and compliance. You can also retrieve an audit snapshot of the data to use as audit evidence. For more information, see Retrieving License Usage Data.