Installing License Service Reporter from online repository with the CLI

Complete the following tasks to install the latest version of License Service Reporter with the CLI:

  1. Creating the CatalogSource for License Service Reporter
  2. Installing the License Service Reporter operator with the CLI
  3. Creating the License Service Reporter instance with the CLI

Creating the CatalogSource for License Service Reporter with the CLI

Complete the following steps to create the catalog sources that you need for License Service Reporter:

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

  2. Create the License Service Reporter catalog source:

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

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

      oc apply -f license-service-reporter-catalog.yaml
      
  3. Verify that the catalog source is created.

    oc -n openshift-marketplace get catalogsource ibm-license-service-reporter-operator-catalog -o jsonpath="{.status.connectionState.lastObservedState}"
    

    Following is the expected output:

    READY
    

Installing the License Service Reporter operator with the CLI

Complete the following steps to create the namespace for the License Service Reporter:

  1. Create a YAML file named def.yaml with the resources definitions that you need.

    apiVersion: v1
    kind: Namespace
    metadata:
      name: $(LSR_NAMESPACE)
    
    ---
    apiVersion: operators.coreos.com/v1alpha2
    kind: OperatorGroup
    metadata:
      name: operatorgroup
      namespace: $(LSR_NAMESPACE)
    spec:
      targetNamespaces:
      - $(LSR_NAMESPACE)
    ---
    apiVersion: operators.coreos.com/v1alpha1
    kind: Subscription
    metadata:
      name: ibm-license-service-reporter-operator
      namespace: $(LSR_NAMESPACE)
    spec:
      channel: v4.2
      installPlanApproval: Automatic
      name: ibm-license-service-reporter-operator
      source: ibm-license-service-reporter-operator-catalog
      sourceNamespace: openshift-marketplace
    
  2. Create the resources that you specified in the definition file.

     oc apply -f def.yaml
    

    Following is a sample output:

     namespace/cloud-pak-1 created
     operatorgroup.operators.coreos.com/operatorgroup created
     subscription.operators.coreos.com/ibm-license-service-reporter-operator-catalog created
    
  3. You can verify the status of the operator by running the following command:

    oc -n ${LSR_NAMESPACE} get csv
    

    Following is a sample output:

    NAME                                          DISPLAY                                       VERSION   REPLACES                                      PHASE
    ibm-license-service-reporter-operator-catalog.v4.2.2             IBM Cloud Pak foundational services            4.2.2       ibm-license-service-reporter-operator-catalog.v3.23.0            Succeeded
    

Creating the License Service Reporter instance with the CLI

  1. Create the license-reporter.yaml file with the following content:

    apiVersion: operator.ibm.com/v1alpha1
    kind: IBMLicenseServiceReporter
    metadata:
      name: ibm-lsr-instance
      namespace: ${LSR_NAMESPACE}
      labels:
        app.kubernetes.io/created-by: ibm-license-service-reporter-operator
        app.kubernetes.io/instance: ibmlicenseservicereporter-instance
        app.kubernetes.io/name: ibmlicenseservicereporter
        app.kubernetes.io/part-of: ibm-license-service-reporter-operator
    spec:
      license:
        accept: true
      authentication:
        useradmin:
          enabled: true
    

    Note: License Service Reporter uses the default storage class. To use a different storage class, add and define the 'storageClass' parameter in the spec section. For example:

    spec:
      storageClass: storage-class-internal
    
  2. Run the following command:

    oc apply -f license-reporter.yaml