Upgrading and migrating

Upgrade your Event Streams installation as follows. The Event Streams operator handles the upgrade of your Event Streams instance.

Note: There is no downtime during the Event Streams upgrade. The Kafka pods are rolled one at a time, so a Kafka instance will always be present to serve traffic. However, if the number of brokers you have matches the min.insync.replicas value set for any of your topics, then that topic will be unavailable to write to while the Kafka pods are rolling.

Upgrade paths

Understand the upgrade paths available for Continuous Delivery (CD) releases and Extended Update Support (EUS) releases.

Upgrade paths for CD releases

If you are on OpenShift, you can upgrade Event Streams to the latest 11.2.5 version directly from any 11.2.x or 11.1.x version by using the operator version 3.2.5. If you are on OpenShift and have an earlier Event Streams version than 11.1.x, you must first upgrade it to version 11.1.x before upgrading to 11.2.x.

If you are running on other Kubernetes platforms, you can upgrade Event Streams to the latest 11.2.5 version directly from any 11.2.x by using the operator version 3.2.5.

Note: If your operator upgrades are set to automatic, minor version upgrades are completed automatically. This means that the Event Streams operator is upgraded to 3.2.x when it is available in the catalog, and your Event Streams instance is then also automatically upgraded, unless you set a schedule for the upgrade by pausing the reconciliation.

Upgrade paths for EUS releases on OpenShift

No direct upgrade from an EUS version to the latest Event Streams version is supported. Upgrade to CD version 11.1.x and then proceed to upgrade your Event Streams version to the latest by following the instructions on this page starting with the prerequisites.

Prerequisites

  • If you are running on the OpenShift Container Platform, ensure you have followed the upgrade steps for IBM Cloud Pak for Integration before upgrading Event Streams.

  • If you are running on other Kubernetes platforms, ensure you have added the IBM helm repository before upgrading Event Streams.

  • The images for Event Streams release 11.2.x are available in the IBM Cloud Container Registry. Ensure you redirect your catalog source to use icr.io/cpopen as described in Implementing ImageContentSourcePolicy to redirect to the IBM Container Registry.

  • To upgrade successfully, your Event Streams instance must have more than one ZooKeeper node or have persistent storage enabled. If you upgrade an Event Streams instance with a single ZooKeeper node that has ephemeral storage, all messages and all topics will be lost and both ZooKeeper and Kafka pods will move to an error state. To avoid this issue, increase the number of ZooKeeper nodes before upgrading as follows:

     apiVersion: eventstreams.ibm.com/v1beta2
     kind: EventStreams
     metadata:
       name: example-pre-upgrade
       namespace: myproject
     spec:
       strimziOverrides:
         zookeeper:
           replicas: 3
    
  • If you installed the Event Streams operator to manage instances of Event Streams in any namespace (one per namespace), then you might need to control when each of these instances is upgraded to the latest version. You can control the updates by pausing the reconciliation of the instance configuration as described in the following sections.

  • When upgrading to Event Streams 11.2.x from 11.1.x or earlier, you must set a license ID after successfully completing the upgrade.

Scheduling the upgrade of an instance

In 11.1.x and later, the Event Streams operator handles the upgrade of your Event Streams instance automatically after the operator is upgraded. No additional step is required to change the instance (product) version.

If your operator manages more than one instance of Event Streams, you can control when each instance is upgraded by pausing the reconciliation of the configuration settings for each instance, running the upgrade, and then unpausing the reconciliation when ready to proceed with the upgrade for a selected instance.

Pausing reconciliation by using the CLI

  1. Log in to your Kubernetes cluster as a cluster administrator by setting your kubectl context.
  2. To apply the annotation first to the EventStreams and then to the Kafka custom resource, run the following command, where <type> is either EventStreams or Kafka:

    kubectl annotate <type> <instance-name> -n <instance-namespace> eventstreams.ibm.com/pause-reconciliation='true'
    
  3. Follow the steps to upgrade by using the Kubernetes CLI or the OpenShift web console.

Unpausing reconciliation by using the CLI

To unpause the reconciliation and continue with the upgrade of an Event Streams instance, run the following command to first remove the annotations from the Kafka custom resource, and then from the EventStreams custom resource, where <type> is either Kafka or EventStreams:

kubectl annotate <type> <instance-name> -n <instance-namespace> eventstreams.ibm.com/pause-reconciliation-

When the annotations are removed, the configuration of your instance is updated, and the upgrade to the latest version of Event Streams completes.

Pausing reconciliation by using the OpenShift web console

  1. Log in to the OpenShift Container Platform web console using your login credentials.
  2. Expand Operators in the navigation on the left, and click Installed Operators.

    Operators > Installed Operators

  3. From the Project list, select the namespace (project) the instance is installed in.
  4. Locate the operator that manages your Event Streams instance in the namespace. It is called Event Streams in the Name column. Click the Event Streams link in the row.
  5. Select the instance you want to pause and click the YAML tab.
  6. In the YAML for the custom resource, add eventstreams.ibm.com/pause-reconciliation: 'true' to the metadata.annotations field as follows:

    apiVersion: eventstreams.ibm.com/v1beta2
    kind: EventStreams
    metadata:
    name: <instance-name>
    namespace: <instance-namespace>
    annotations:
       eventstreams.ibm.com/pause-reconciliation: 'true'
    
  7. This annotation also needs to be applied to the corresponding Kafka custom resource. Expand Home in the navigation on the left, click API Explorer, and type Kafka in the Filter by kind... field. Select Kafka.
  8. From the Project list, select the namespace (project) the instance is installed in and click the Instances tab.
  9. Select the instance with the name <instance-name> (the same as the Event Streams instance).
  10. In the YAML for the custom resource, add eventstreams.ibm.com/pause-reconciliation: 'true' to the metadata.annotations field as follows:

    apiVersion: eventstreams.ibm.com/v1beta2
    kind: Kafka
    metadata:
    name: <instance-name>
    namespace: <instance-namespace>
    annotations:
       eventstreams.ibm.com/pause-reconciliation: 'true'
    
  11. Follow the steps to upgrade by using the Kubernetes CLI or the OpenShift web console.

Unpausing reconciliation by using the OpenShift web console

To unpause the reconciliation and continue with the upgrade of an Event Streams instance, first remove the annotations from the Kafka custom resource, and then from the EventStreams custom resource. When the annotations are removed, the configuration of your instance is updated, and the upgrade to the latest version of Event Streams completes.

Upgrading on the OpenShift Container Platform

Upgrade your Event Streams instance running on the OpenShift Container Platform by using the CLI or web console as follows.

Upgrading by using the CLI

If you are using the OpenShift command-line interface (CLI), the oc command, complete the steps in the following sections to upgrade your Event Streams installation.

  1. Log in to your Red Hat OpenShift Container Platform as a cluster administrator by using the oc CLI (oc login).
  2. Ensure the required Event Streams Operator Upgrade Channel is available:

    oc get packagemanifest ibm-eventstreams -o=jsonpath='{.status.channels[*].name}'
    
  3. Change the subscription to move to the required update channel, where vX.Y is the required update channel (for example, v3.2):

    oc patch subscription -n <namespace> ibm-eventstreams --patch '{"spec":{"channel":"vX.Y"}}' --type=merge
    

All Event Streams pods that need to be updated as part of the upgrade will be gracefully rolled. Where required, ZooKeeper pods will roll one at a time, followed by Kafka brokers rolling one at a time.

Upgrading by using the OpenShift web console

If you are using the web console, complete the steps in the following sections to upgrade your Event Streams installation.

  1. Log in to the OpenShift Container Platform web console using your login credentials.
  2. Expand Operators in the navigation on the left, and click Installed Operators.

    Operators > Installed Operators

  3. From the Project list, select the namespace (project) the instance is installed in.
  4. Locate the operator that manages your Event Streams instance in the namespace. It is called Event Streams in the Name column. Click the Event Streams link in the row.
  5. Click the Subscription tab to display the Subscription details for the Event Streams operator.
  6. Click the version number link in the Update channel section (for example, v3.1). The Change Subscription update channel dialog is displayed, showing the channels that are available to upgrade to.
  7. Select v3.2 and click the Save button on the Change Subscription Update Channel dialog.

All Event Streams pods that need to be updated as part of the upgrade will be gracefully rolled. Where required, ZooKeeper pods will roll one at a time, followed by Kafka brokers rolling one at a time.

Note: The number of containers in each Kafka broker will reduce from 2 to 1 as the TLS-sidecar container will be removed from each broker during the upgrade process.

Upgrading on other Kubernetes platforms

If you are running Event Streams on Kubernetes platforms that support the Red Hat Universal Base Images (UBI) containers, you can upgrade Event Streams by using the Helm chart.

To upgrade Event Streams to the latest version, run the following command:

helm upgrade \
<release-name> ibm-helm/ibm-eventstreams-operator \
-n <namespace> \
--set watchAnyNamespace=<true/false>
--set previousVersion=<previous-version>

Where:

  • <release-name> is the name you provide to identify your operator.
  • <namespace> is the name of the namespace where you want to install the operator.
  • watchAnyNamespace=<true/false> determines whether the operator manages instances of Event Streams in any namespace or only a single namespace (default is false if not specified). For more information, see choosing operator installation mode.
  • <previous-version> is the version of the helm chart being upgraded from. For example, if your helm chart version is 3.2.5, set the field as: --set previousVersion=3.2.5. The version of your helm chart can be retrieved by running:

    helm list --filter <release-name> -n <namespace> -o json | jq '.[0].app_version'
    

Post-upgrade tasks

Set the license ID

After upgrading to Event Streams 11.2.x from 11.1.x or earlier, you must set a valid license ID value for the spec.license.license field based on the program that you purchased. The following example shows the license ID set as L-YBXJ-ADJNSM.

apiVersion: eventstreams.ibm.com/v1beta2
kind: EventStreams
metadata:
  name: example-license-upgrade
  namespace: myproject
spec:
  license:
    license: L-YBXJ-ADJNSM
    use: CloudPakForIntegrationProduction
    accept: true

Enable collection of producer metrics

In Event Streams version 11.0.0 and later, a Kafka Proxy handles gathering metrics from producing applications. The information is displayed in the Producers dashboard. The proxy is optional and is not enabled by default. To enable metrics gathering and have the information displayed in the dashboard, enable the Kafka Proxy.

Enable metrics for monitoring

To display metrics in the monitoring dashboards of the Event Streams UI:

  • If you are running Event Streams on the OpenShift Container Platform, ensure you enable the monitoring stack.

  • If you are running Event Streams on other Kubernetes platforms, you can use any monitoring solution compatible with Prometheus and JMX formats to collect, store, visualize, and set up alerts based on metrics provided by Event Streams.

Migrate to latest Apicurio Registry

Apicurio client libraries versions 2.3.1 and earlier use a date format that is not compatible with Apicurio Registry server versions 2.4.1 or later. Apicurio Registry is only deployed when you update the Event Streams custom resource to use the latest version of Apicurio Registry included with Event Streams.

Migrate your schema registry to use the latest Apicurio Registry as follows:

  1. Ensure all applications connecting to your instance of Event Streams that use the schema registry are using Apicurio client libraries version 2.4.1 or later before migrating.
  2. Log in to your Red Hat OpenShift Container Platform as a cluster administrator by using the oc CLI (oc login).
  3. Add the eventstreams.ibm.com/apicurio-registry-version='>=2.4' annotation to your Event Streams custom resource with the following command:

    oc annotate --namespace <namespace> EventStreams <instance-name> eventstreams.ibm.com/apicurio-registry-version='>=2.4'
    

The Event Streams operator will update your schema registry to use the latest version of Apicurio Registry included with Event Streams.

Remove jmxtrans

jmxtrans is removed in Event Streams 11.2.0 and later. If your Event Streams custom resource uses jmxTrans, the following error is displayed:

Jmx Trans is now removed, remove the 'spec.strimziOverrides.jmxTrans' field.

To resolve this error, remove the spec.strimziOverrides.jmxTrans field and any related configurations within the jmxTrans field from your Event Streams custom resource.

Verifying the upgrade

  1. Wait for all Event Streams pods to reconcile. This is indicated by the Running state.
  2. Log in to your Kubernetes cluster as a cluster administrator by setting your kubectl context.
  3. To retrieve a list of Event Streams instances, run the following command:

    kubectl get eventstreams -n <namespace>
    
  4. For the instance of Event Streams that you upgraded, check that the status returned by the following command is Ready.

    kubectl get eventstreams -n <namespace> <name-of-the-es-instance> -o jsonpath="{.status.phase}"
    
  5. To check the version of your Event Streams instance, run the following command:

    kubectl get eventstreams -n <namespace> <name-of-the-es-instance> -o jsonpath="{.status.versions.reconciled}"