Cloud Pak for Data

Cloud Pak for Data

Come for answers. Stay for best practices. All we’re missing is you.

 View Only

Enable the License Service for the license tracking of your Cloud Pak for Data cluster

By Hong Wei Jia posted Sun February 05, 2023 10:30 AM

  

Enable the License Service for the license tracking of your Cloud Pak for Data cluster

License Service provides license consumption reporting and audit readiness for IBM Cloud Pak solutions running on a Red Hat OpenShift cluster. It is useful to any customer that wants to view and understand the license consumption of their Cloud Pak for Data cluster.License Service is part of Cloud Pak Foundational Services. Customer just needs to enable the License Service feature for the license tracking of their Cloud Pak for Data cluster.
In this article, I'll introduce how to enable the License Service feature for your existing Cloud Pak for Data cluster.

Assumption
The Cloud Pak for Data cluster version is 4.0, 4.5 or 4.6.
The IBM Cloud Pak foundational services is installed in the ibm-common-services namespace.

Step by step guide
To view the license consumption, you'll have to enable the Admin Hub which provides an UI to manage the license compliance. Besides, it's recommended you install the License Service Reporter which can show you the highest license usage in the environment on the Licensing dashboard.
1.Updating the common service CR
Run the following command:

oc edit CommonService common-service -n ibm-common-services

Set the following parameters by adding them to the CommonService custom resource. You can update these parameters before you create an OperandRequest instance or after you install the services. Add or modify the parameters and values in the spec section.

Example configuration with default values for Common Web UI settings:
  - name: ibm-commonui-operator
    spec:
      commonWebUI:
        replicas: 1
        resources:
          requests:
            memory: 256Mi
            cpu: 300m
          limits:
            memory: 256Mi
            cpu: 300m
Example configuration with default values for License Service settings:
  - name: ibm-licensing-operator
    spec:
      IBMLicensing:
        resources:
          requests:
            cpu: 200m
            memory: 256Mi
          limits:
            cpu: 500m
            memory: 512Mi
      IBMLicenseServiceReporter:
        databaseContainer:
          resources:
            requests:
              cpu: 200m
              memory: 256Mi
            limits:
              cpu: 300m
              memory: 300Mi
        receiverContainer:
          resources:
            requests:
              cpu: 200m
              memory: 256Mi
            limits:
              cpu: 300m
              memory: 384Mi

After the modification, the CommonService CR looks like below.

apiVersion: operator.ibm.com/v3
kind: CommonService
  name: common-service
  namespace: ibm-common-services
  resourceVersion: '32535530'
  uid: 9cb27012-f2fb-4bc2-8897-25a70c6e6180
spec:
  services:
    - name: ibm-cert-manager-operator
      spec:
        certManager:
          certManagerCAInjector:
            resources:
              limits:
                cpu: 105m
                memory: 1025Mi
          certManagerController:
            resources:
              limits:
                cpu: 105m
                memory: 1025Mi
          certManagerWebhook:
            resources:
              limits:
                cpu: 105m
                memory: 1025Mi
          configMapWatcher:
            resources:
              limits:
                cpu: 105m
                memory: 1025Mi
    - name: ibm-commonui-operator
      spec:
        commonWebUI:
          replicas: 1
          resources:
            limits:
              cpu: 300m
              memory: 256Mi
            requests:
              cpu: 300m
              memory: 256Mi
    - name: ibm-licensing-operator
      spec:
        IBMLicenseServiceReporter:
          databaseContainer:
            resources:
              limits:
                cpu: 300m
                memory: 300Mi
              requests:
                cpu: 200m
                memory: 256Mi
          receiverContainer:
            resources:
              limits:
                cpu: 300m
                memory: 384Mi
              requests:
                cpu: 200m
                memory: 256Mi
        IBMLicensing:
          resources:
            limits:
              cpu: 500m
              memory: 512Mi
            requests:
              cpu: 200m
              memory: 256Mi

2. Create the OperandRequest instances
Create the OperandRequest instances for Common Web UI and License Service.
apiVersion: operator.ibm.com/v1alpha1
kind: OperandRequest
metadata:
  name: common-service
  namespace: ibm-common-services
  labels:
    app.kubernetes.io/instance: operand-deployment-lifecycle-manager
    app.kubernetes.io/managed-by: operand-deployment-lifecycle-manager
    app.kubernetes.io/name: odlm
spec: requests: - operands: - name: ibm-licensing-operator - name: ibm-commonui-operator registry: common-service

When creating the OperandRequest of the Common Web UI, the dependencies including Authentication,Platform API, Management Ingress and MongoDB will be created automatically. This process may take about 15 minutes.

Note: You can create the OperandRequest in any namespace. If you are creating the OperandRequest in a different namespace than where OperandRegistry and OperandConfig custom resources are, change the namespace: parameter value to the namespace from where you are creating the OperandRequest. And, add the registryNamespace: ibm-common-services in the OperandRequest.

3.Deploy License Service Reporter
Follow this link for deploying the License Service Reporter.
https://www.ibm.com/docs/en/cpfs?topic=reporter-deploying-license-service#lrcmd

Note:
When creating the IBMLicenseServiceReporter CR, add and define the 'storageClass' parameter in the spec section accordingly.
For example, you can create the CR with the storageClass: managed-nfs-storage as below.
apiVersion: operator.ibm.com/v1alpha1
kind: IBMLicenseServiceReporter
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
  namespace: ibm-common-services
spec:
storageClass: managed-nfs-storage
4.Get the URL for accessing the Admin Hub

oc get route -n ibm-common-services cp-console -o jsonpath='{.spec.host}'
5.Login the Admin Hub and access the Licensing dashboard
1)After logging into the Admin Hub, click the Hamburger icon and then click the Licensing menu item for navigating to the Licensing Dashboard.

2)The license consumption information looks like below.

You can get more information about how to use License Dashboard from this link.
https://www.ibm.com/docs/en/cpfs?topic=reporter-viewing-license-usage-licensing-dashboard

References
https://www.ibm.com/docs/en/cpfs?topic=services-configuring-foundational-by-using-custom-resource#license
https://www.ibm.com/docs/en/cpfs?topic=online-installing-foundational-services-license-service-only
https://www.ibm.com/docs/en/cpfs?topic=reporter-deploying-license-service

0 comments
35 views

Permalink