[AIX Solaris HP-UX Linux Windows][IBM i]

Tracking WebSphere Application Server license use in Kubernetes

You can track your WebSphere® Application Server runtime usage in a Kubernetes cluster with the IBM License Service by configuring a custom resource file or the YAML file of a Kubernetes resource Deployment. The values that you specify depend on which WebSphere Application Server product edition you deploy, how it is licensed, and whether you are using the Runtime Component Operator.

About this task

You are not required to apply license annotations by using any particular approach. However, the Runtime Component Operator (RCO) provides an efficient means to apply License Service annotations so that you can track runtime usage for WebSphere Application Server. The parameter and annotation values for each runtime offering are shown in subsequent sections.

You can specify your license information with the RCO by adding annotations to the .metadata.annotations section of a custom resource (CR) YAML file. The RCO can then apply that license information to applications that are running on WebSphere Application Server in Kubernetes clusters. These annotations make it possible for the IBM License Service to track WebSphere Application Server runtime usage.

The RCO applies your annotations to all application pods that are associated with your deployment by monitoring any custom resources that specify a kind value of RuntimeComponent. To ensure that the operator applies your license information, specify the annotations when you create your custom resource. After the initial deployment of a RuntimeComponent custom resource, any changes to the annotations are applied only when one of the parameters from the spec section of the CR file is updated. Changes to the metadata section of the CR file, where the annotations are specified, are not automatically detected.

For more information about installing the RCO, see Operator Installation.

Alternatively, you can track runtime usage without using the RCO by specifying license information in a deployment.yaml file, which is the YAML file of a Kubernetes resource Deployment or StatefulSet Kubernetes object. Specify the license information as custom annotations in the Pod Template definition within the Deployment by configuring the .spec.template.metadata.annotations section of the deployment.yaml file.

The following examples specify the productChargedContainers: "All" annotation value. This value assumes that all containers in the pod are WebSphere Application Server containers. If the pod that you are tracking includes containers that are not WebSphere Application Server containers, you can specify only the containers that you want to track. Specify a semicolon-separated list of the names of the WebSphere Application Server containers that you want to track as the value for the productChargedContainers annotation.

Procedure

Specify license-related annotations in a RuntimeComponent CR YAML file or a Kubernetes deployment.yaml file.
  • To apply License Service annotations with the RCO, configure your license annotations in the .metadata.annotations section of your RuntimeComponent CR YAML file.
    The following example shows a CR file with license-related annotations for WebSphere Application Server Network Deployment.
    apiVersion: rc.app.stacks/v1beta2
    kind: RuntimeComponent
    metadata:
      name: test-was
      namespace: twas3
      annotations:
        productID: "c6a988d93b0f4d1388200d40ddc84e5b"
        productName: "IBM WebSphere Application Server Network Deployment"
        productMetric: "PROCESSOR_VALUE_UNIT"
        productChargedContainers: "All"
    spec:
      expose: true
      applicationImage: <your application image>
      service:
        port: 9080

    For more information, see Runtime Component Operator.

  • Alternatively, you can apply license information without using the RCO by specifying WebSphere Application Server license annotations in the .spec.template.metadata.annotations section of a Kubernetes deployment.yaml file.
    The following example shows the .spec.template.metadata.annotations section of a deployment.yaml file with license-related annotations forWebSphere Application Server Network Deployment.
    
    spec:
      template:
        metadata:
          annotations:
            productID: "c6a988d93b0f4d1388200d40ddc84e5b"
            productName: "IBM WebSphere Application Server Network Deployment"
            productMetric: "PROCESSOR_VALUE_UNIT"
            productChargedContainers: "All"

    For more information about deployment.yaml files, see Understanding Kubernetes Objects in the Kubernetes documentation.

License annotation values

The following sections provide custom resource annotation values for different WebSphere Application Server license scenarios for both RuntimeComponent CR YAML and deployment.yaml files.

WebSphere Application Server Network Deployment, stand-alone license
RuntimeComponent CR YAML file

metadata:
...
  annotations:
    productID: "c6a988d93b0f4d1388200d40ddc84e5b"
    productName: "IBM WebSphere Application Server Network Deployment"
    productMetric: "PROCESSOR_VALUE_UNIT"
    productChargedContainers: "All"
deployment.yaml file
spec:
  ...
  template:
    metadata:
      annotations:
        productID: "c6a988d93b0f4d1388200d40ddc84e5b"
        productName: "IBM WebSphere Application Server Network Deployment"
        productMetric: "PROCESSOR_VALUE_UNIT"
        productChargedContainers: "All"
WebSphere Application Server Network Deployment, licensed under IBM WebSphere Application Server Hybrid Edition
RuntimeComponent CR YAML file

metadata:
...
  annotations:
    cloudpakName: "IBM WebSphere Hybrid Edition"
    cloudpakId: "6358611af04743f99f42dadcd6e39d52"
    productCloudpakRatio: "1:1" 
    productID: "c6a988d93b0f4d1388200d40ddc84e5b"
    productName: "IBM WebSphere Application Server Network Deployment"
    productMetric: "VIRTUAL_PROCESSOR_CORE"
    productChargedContainers: "All"
deployment.yaml file
spec:
  ...
  template:
    metadata:
      annotations:
        cloudpakName: "IBM WebSphere Hybrid Edition"
        cloudpakId: "6358611af04743f99f42dadcd6e39d52"
        productCloudpakRatio: "1:1" 
        productID: "c6a988d93b0f4d1388200d40ddc84e5b"
        productName: "IBM WebSphere Application Server Network Deployment"
        productMetric: "VIRTUAL_PROCESSOR_CORE"
        productChargedContainers: "All"
WebSphere Application Server Network Deployment, licensed under IBM WebSphere Application Server Family Edition
RuntimeComponent CR YAML file

metadata:
...
  annotations:
    cloudpakName: "IBM WebSphere Application Server Family Edition"
    cloudpakId: "be8ae84b3dd04d81b90af0d846849182"
    productCloudpakRatio: "1:1" 
    productID: "c6a988d93b0f4d1388200d40ddc84e5b"
    productName: "IBM WebSphere Application Server Network Deployment"
    productMetric: "PROCESSOR_VALUE_UNIT"
    productChargedContainers: "All"
deployment.yaml file
spec:
  ...
  template:
    metadata:
      annotations:
        cloudpakName: "IBM WebSphere Application Server Family Edition"
        cloudpakId: "be8ae84b3dd04d81b90af0d846849182"
        productCloudpakRatio: "1:1" 
        productID: "c6a988d93b0f4d1388200d40ddc84e5b"
        productName: "IBM WebSphere Application Server Network Deployment"
        productMetric: "PROCESSOR_VALUE_UNIT"
        productChargedContainers: "All"
WebSphere Application Server Network Deployment, licensed under IBM Cloud Pak® for Applications
RuntimeComponent CR YAML file

metadata:
...
  annotations:
    cloudpakName: "IBM Cloud Pak for Applications"
    cloudpakId: "4df52d2cdc374ba09f631a650ad2b5bf"
    productCloudpakRatio: "1:1" 
    productID: "c6a988d93b0f4d1388200d40ddc84e5b"
    productName: "IBM WebSphere Application Server Network Deployment"
    productMetric: "VIRTUAL_PROCESSOR_CORE"
    productChargedContainers: "All"
deployment.yaml file
spec:
  ...
  template:
    metadata:
      annotations:
        cloudpakName: "IBM Cloud Pak for Applications"
        cloudpakId: "4df52d2cdc374ba09f631a650ad2b5bf"
        productCloudpakRatio: "1:1" 
        productID: "c6a988d93b0f4d1388200d40ddc84e5b"
        productName: "IBM WebSphere Application Server Network Deployment"
        productMetric: "VIRTUAL_PROCESSOR_CORE"
        productChargedContainers: "All"