Installing License Service Reporter from online repository with the CLI
Learn how to install the latest version of License Service Reporter by using the CLI.
Complete the following tasks to install the latest version of License Service Reporter by using the CLI.
- Creating the CatalogSource for License Service Reporter
- Installing the License Service Reporter operator with the CLI
- 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:
-
Log in to the cluster by using the
oc login
command. -
Create the License Service Reporter catalog source:
-
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
-
Apply the YAML file to create the License Service Reporter catalog source.
oc apply -f license-service-reporter-catalog.yaml
-
-
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
- Log in to the cluster.
-
Define the installation namespace with the following command.
export LSR_NAMESPACE=<YOUR_NAMESPACE>
where
is the namespace where you want to install License Service Reporter. -
Create a
license-reporter-operator.yaml
file with the following definition: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
-
Run the following command to create the resources that are defined in the
license-reporter-operator.yaml.yaml
file.envsubst < license-reporter-operator.yaml | oc apply -f -
Following is a sample output:
namespace/<LSR_NAMESPACE> created operatorgroup.operators.coreos.com/operatorgroup created subscription.operators.coreos.com/ibm-license-service-reporter-operator-catalog created
-
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.v4.2.2 IBM License Service Reporter 4.2.2 Succeeded
Creating the License Service Reporter instance with the CLI
-
Create the
license-reporter.yaml
file with the following definition: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 of thelicense-reporter.yaml
. For example:spec: storageClass: storage-class-internal
-
Run the following command to apply the
license-reporter.yaml
on the cluster:envsubst < license-reporter.yaml | oc apply -f -