Backup and upgrade

Learn how to back up and upgrade License Service.

Backup

The license usage data that is collected by License Service is stored in the persistent cluster memory and is not affected when you kill or restart a pod.

Nonetheless, it is a good practice to generate an audit snapshot periodically for backup purposes and store it in a safe location. You do not need to perform any other backup.

Note: Before decommissioning a cluster, record the license usage of the products that are deployed on this cluster by generating an audit snapshot until the day of decommissioning.

Upgrade

Environment Current version Upgrading to the latest version
Online 1.3.x or earlier 1. Update subscription channel.
2. Update the location of the CatalogSource.
Online 1.4.x - 1.11.x Update the location of the CatalogSource.
Online 1.11.x or later License Service is automatically upgraded with each new operator release.
Installation without OLM or Offline Any Uninstall License Service from the cluster and redeploy it.

Note: The license usage data is stored in the persistent cluster memory and should not be affected by reinstallation of License Service. However, it is a good practice to create an audit snapshot before reinstalling License Service as a precaution.

Checking your current version

To check your current version of License Service, run the following command:

kubectl get clusterserviceversion -n ibm-common-services

This method is applicable only for online installations.

Updating the subscription channel

If you are upgrading from version 1.3.x or earlier, you must update the subscription channel first. Complete the following actions.

  1. Log in to your cluster.

  2. Update the subscription channel by running the following command.

    licensingNamespace=ibm-common-services
    subName=ibm-licensing-operator-app
    kubectl patch subscription ${subName} -n ${licensingNamespace} --type=merge -p '{"spec": {"channel":"v3"}}'
    

    Note: If you installed License Service in a custom namespace, change the value of licensingNamespace from the default ibm-common-services to your custom namespace.

  3. Wait until the ClusterServiceVersion status changes to Succeeded. To check the status of ClusterServiceVersion, run the following command.

    csv_name=$(kubectl get subscription -n "${licensingNamespace}" ibm-licensing-operator-app -o jsonpath='{.status.currentCSV}')
    kubectl get csv -n "${licensingNamespace}" "${csv_name}" -o jsonpath='{.status.phase}'
    
  4. Update the location of the CatalogSource to complete the upgrade. For more information, see Updating the location of the CatalogSource.

Updating the location of the CatalogSource

If you are upgrading from version 1.11.x or earlier, you must update the location of the CatalogSource.

Starting from November 2021, IBM no longer publishes the catalog image updates to docker.io which was used by default in IBM License Service installation scripts and procedures that depended on CatalogSource. If you installed IBM License Service before December 2021, you must perform manual steps to update CatalogSource image and upgrade License Service version.

To upgrade to the latest version of License Service, you must manually update the CatalogSource image. Complete the following actions to complete the upgrade.

  1. Log in to your cluster.

  2. Update the CatalogSource by running the following command.

    catalogSourceNamespace=openshift-marketplace
    csName=opencloud-operators
    kubectl patch catalogsource ${csName} -n ${catalogSourceNamespace} --type=merge -p '{"spec": {"image":"icr.io/cpopen/ibm-operator-catalog"}}'
    

    Note: Default catalogSourceNamespace on OpenShift is openshift-marketplace. If you are using Kubernetes change it to your CatalogSource namespace.

    Note: If you deployed License Service CatalogSource with a custom name, change the value of csName from the default opencloud-operators to your custom name.

  3. Wait until the ClusterServiceVersion status changes to Succeeded. To check the status of ClusterServiceVersion, run the following command.

    licensingNamespace=ibm-common-services
    csv_name=$(kubectl get subscription -n "${licensingNamespace}" ibm-licensing-operator-app -o jsonpath='{.status.currentCSV}')
    kubectl get csv -n "${licensingNamespace}" "${csv_name}" -o jsonpath='{.status.phase}'
    

    After you update the CatalogSource image, License Service is automatically upgraded to the latest version. In the future, updates will be automatic.

  4. To make sure that the upgrade was successful, check your current version of License Service. For more information, see Checking your current version.