Tracking license usage in containers using IBM License Service

Track the license usage of WebSphere Application Server and Liberty servers in containers that are registered with WebSphere Automation, without interfering with the licensing of WebSphere Application Server and Liberty servers themselves, by using the IBM License Service.

The IBM License Service is required for monitoring and measuring license usage of WebSphere Automation in containerized environments according to the pricing rules. Manual license measurements are not allowed. Deploy the License Service on all clusters where WebSphere Automation is installed.

Overview

The integrated licensing solution collects and stores the license usage information, which can be used for audit purposes and for tracking license consumption in cloud environments. The solution works in the background and does not require any configuration. Only one instance of the License Service is deployed per cluster regardless of the number of Cloud Paks and containerized products that you have installed on the cluster.

Deploying License Service

License Service must be deployed on any clusters where the registered WebSphere Application Server or Liberty servers are also deployed. It can be deployed on any Kubernetes cluster. For more information about License Service, how to install it, and how to use it, see the License Service documentation.

Validating if License Service is deployed on the cluster

To ensure license reporting continuity for license compliance purposes, verify that License Service is successfully deployed. It is recommended to periodically verify whether it is active.

To validate whether License Service is deployed and running on the cluster, log in to the cluster and run the following command:

kubectl get pods --all-namespaces | grep ibm-licensing | grep -v operator

The following response confirms successful deployment:

1/1     Running

Enabling License Tracking in WebSphere Automation

WebSphere Automation license usage is tracked by using specific annotations on your containerized Liberty or traditional IBM WebSphere Application Server (tWAS) applications. These annotations identify which applications are registered with WebSphere Automation and specify their license entitlement source.

Step 1: Add License Tracking Annotations

Add the following two annotations to your containerized applications:

Annotation Purpose Example values
automation.websphere.ibm.com/registered-with-websphere-automation Indicates registration with WebSphere Automation "true" or "false"
automation.websphere.ibm.com/license-entitlement-source Specifies the license entitlement source "Standalone" or "IBM Cloud Pak for Applications Advanced"

Choose your deployment method

Select the method that matches how you deploy your applications:

  • Option A: WebSphere Liberty Operator
  • Option B: Open Liberty Operator
  • Option C: Standard Kubernetes Deployment

Option A: WebSphere Liberty Operator

For Deployment resources

Add annotations to .spec.deployment.annotations.

Example: Standalone License

apiVersion: liberty.websphere.ibm.com/v1
kind: WebSphereLibertyApplication
metadata:
  name: app-standalone
spec:
  applicationImage: 'icr.io/appcafe/open-liberty/samples/getting-started'
  license:
    accept: true
    edition: IBM WebSphere Application Server Liberty Core
    productEntitlementSource: IBM Enterprise Application Runtimes
  resources:
    limits:
      cpu: '1'
  manageTLS: false
  replicas: 2
  deployment:
    annotations:
      automation.websphere.ibm.com/registered-with-websphere-automation: 'true'
      automation.websphere.ibm.com/license-entitlement-source: Standalone

Example: Cloud Pak for Applications Advanced License

apiVersion: liberty.websphere.ibm.com/v1
kind: WebSphereLibertyApplication
metadata:
  name: app-cp4apps
spec:
  applicationImage: 'icr.io/appcafe/open-liberty/samples/getting-started'
  license:
    accept: true
    edition: IBM WebSphere Application Server
    productEntitlementSource: Standalone
  resources:
    limits:
      cpu: '500m'
  manageTLS: false
  replicas: 2
  deployment:
    annotations:
      automation.websphere.ibm.com/registered-with-websphere-automation: 'true'
      automation.websphere.ibm.com/license-entitlement-source: "IBM Cloud Pak for Applications Advanced"

For StatefulSet resources

Add annotations to .spec.statefulSet.annotations.

apiVersion: liberty.websphere.ibm.com/v1
kind: WebSphereLibertyApplication
metadata:
  name: app-statefulset
spec:
  applicationImage: 'icr.io/appcafe/open-liberty/samples/getting-started'
  license:
    accept: true
    edition: IBM WebSphere Application Server
    productEntitlementSource: Standalone
  resources:
    limits:
      cpu: '500m'
  manageTLS: false
  replicas: 2
  statefulSet:
    annotations:
      automation.websphere.ibm.com/registered-with-websphere-automation: 'true'
      automation.websphere.ibm.com/license-entitlement-source: Standalone

Option B: Open Liberty Operator

Add annotations to .spec.deployment.annotations or .spec.statefulSet.annotations.

apiVersion: openliberty.io/v1
kind: OpenLibertyApplication
metadata:
  name: app-openliberty
spec:
  applicationImage: 'icr.io/appcafe/open-liberty/samples/getting-started'
  license:
    accept: true
    edition: IBM WebSphere Application Server
    productEntitlementSource: Standalone
  resources:
    limits:
      cpu: '500m'
  manageTLS: false
  replicas: 2
  deployment:
    annotations:
      automation.websphere.ibm.com/registered-with-websphere-automation: 'true'
      automation.websphere.ibm.com/license-entitlement-source: Standalone

Option C: Standard Kubernetes Deployment

Add annotations directly to the pod template in your Deployment manifest.

apiVersion: apps/v1
kind: Deployment
metadata:
  name: liberty-app
spec:
  replicas: 2
  selector:
    matchLabels:
      app: liberty-app
  template:
    metadata:
      labels:
        app: liberty-app
      annotations:
        automation.websphere.ibm.com/registered-with-websphere-automation: 'true'
        automation.websphere.ibm.com/license-entitlement-source: Standalone
    spec:
      containers:
      - name: liberty
        image: icr.io/appcafe/open-liberty/samples/getting-started
        resources:
          limits:
            cpu: '500m'

Step 2: Configure IBMLicensingDefinition

Create IBMLicensingDefinition resources to enable License Service to track your WebSphere Automation usage.

For Standalone License

Create and apply the following definition:

apiVersion: operator.ibm.com/v1
kind: IBMLicensingDefinition
metadata:
  name: ibm-websphere-automation-standalone
  namespace: ibm-licensing
spec:
  action: cloneModify
  condition:
    metadata:
      annotations:
        automation.websphere.ibm.com/registered-with-websphere-automation: "true"
        automation.websphere.ibm.com/license-entitlement-source: "Standalone"
  scope: cluster
  set:
    productID: "3c6012914c7a4471b7dbb30a077c3f2a"
    productName: "IBM WebSphere Automation"
    productMetric: "VIRTUAL_PROCESSOR_CORE"
    productChargedContainers: "All"
  remove:
    - cloudpakId
    - cloudpakMetric
    - cloudpakName
    - productCloudpakRatio

Apply the definition:

kubectl apply -f ibm-websphere-automation-standalone.yaml

For IBM Cloud Pak for Applications Advanced

Create and apply the following definition:

apiVersion: operator.ibm.com/v1
kind: IBMLicensingDefinition
metadata:
  name: ibm-websphere-automation-cp4apps-adv
  namespace: ibm-licensing
spec:
  action: cloneModify
  condition:
    metadata:
      annotations:
        automation.websphere.ibm.com/registered-with-websphere-automation: "true"
        automation.websphere.ibm.com/license-entitlement-source: "IBM Cloud Pak for Applications Advanced"
  scope: cluster
  set:
    cloudpakId: "217562c7767641d982cc6df6bcb5cb87"
    cloudpakName: "IBM Cloud Pak for Applications Advanced"
    productID: "3c6012914c7a4471b7dbb30a077c3f2a"
    productName: "IBM WebSphere Automation"
    productMetric: "VIRTUAL_PROCESSOR_CORE"
    productChargedContainers: "All"
    productCloudpakRatio: "6:1"

Apply the definition:

kubectl apply -f ibm-websphere-automation-cp4apps-adv.yaml

Important considerations

Removing annotations

Annotations cannot be removed by simply deleting them from the specification. To deregister a server from WebSphere Automation tracking, explicitly set the value to "false":

deployment:
  annotations:
    automation.websphere.ibm.com/registered-with-websphere-automation: "false"

CPU resource limits

Always set CPU resource limits to ensure accurate license tracking. Without limits, License Service uses the node's full CPU capacity for calculations:

resources:
  limits:
    cpu: '500m'  # Recommended: Set appropriate limits

Case sensitivity

All annotation values are case-sensitive. Ensure exact matches between application annotations and licensing definition conditions.

Summary checklist

Use this checklist to ensure proper license tracking setup:

  • IBM License Service deployed on the cluster
  • License Service pod verified as running
  • Application annotations added (registered-with-websphere-automation and license-entitlement-source)
  • IBMLicensingDefinition resource created for your entitlement type
  • CPU resource limits set on containers
  • Annotations verified on running pods
  • License tracking tested and confirmed