Chapter 6. Upgrading an Operator-based broker deployment

The procedures in this section show how to upgrade:

  • The AMQ Broker Operator version, using both the OpenShift command-line interface (CLI) and OperatorHub
  • The broker container image for an Operator-based broker deployment

6.1. Before you begin

This section describes some important considerations before you upgrade the Operator and broker container images for an Operator-based broker deployment.

  • To upgrade an Operator-based broker deployment running on OpenShift Container Platform 3.11 to run on OpenShift Container Platform 4.5 or later, you must first upgrade your OpenShift Container Platform installation. Then, you must create a new Operator-based broker deployment that matches your existing deployment. To learn how to create a new Operator-based broker deployment, see Chapter 3, Deploying AMQ Broker on OpenShift Container Platform using the AMQ Broker Operator.
  • Upgrading the Operator using either the OpenShift command-line interface (CLI) or OperatorHub requires cluster administrator privileges for your OpenShift cluster.
  • If you originally used the CLI to install the Operator, you should also use the CLI to upgrade the Operator. If you originally used OperatorHub to install the Operator (that is, it appears under OperatorsInstalled Operators for your project in the OpenShift Container Platform web console), you should also use OperatorHub to upgrade the Operator. For more information about these upgrade methods, see:

6.2. Upgrading the Operator using the CLI

The procedures in this section show how to use the OpenShift command-line interface (CLI) to upgrade different versions of the Operator to the latest version available for AMQ Broker 7.8.

6.2.1. Prerequisites

  • You should use the CLI to upgrade the Operator only if you originally used the CLI to install the Operator. If you originally used OperatorHub to install the Operator (that is, the Operator appears under OperatorsInstalled Operators for your project in the OpenShift Container Platform web console), you should use OperatorHub to upgrade the Operator. To learn how to upgrade the Operator using OperatorHub, see Section 6.3, “Upgrading the Operator using OperatorHub”.

6.2.2. Upgrading version 0.18 of the Operator

This procedure shows to how to use the OpenShift command-line interface (CLI) to upgrade version 0.18 of the Operator (that is, the first version available for AMQ Broker 7.8) to the latest version for AMQ Broker 7.8.

Procedure

  1. In your web browser, navigate to the Software Downloads page for AMQ Broker 7.8.1 patches.
  2. Ensure that the value of the Version drop-down list is set to 7.8.1 and the Patches tab is selected.
  3. Next to AMQ Broker 7.8.1 .2 Operator Installation and Example Files, click Download.

    Download of the amq-broker-operator-7.8.1-ocp-install-examples.zip compressed archive automatically begins.

  4. When the download has completed, move the archive to your chosen installation directory. The following example moves the archive to a directory called ~/broker/operator.

    mkdir ~/broker/operator
    mv amq-broker-operator-7.8.1-ocp-install-examples.zip ~/broker/operator
  5. In your chosen installation directory, extract the contents of the archive. For example:

    cd ~/broker/operator
    unzip amq-broker-operator-7.8.1-ocp-install-examples.zip
  6. Log in to OpenShift Container Platform as an administrator for the project that contains your existing Operator deployment.

    $ oc login -u <user>
  7. Switch to the OpenShift project in which you want to upgrade your Operator version.

    $ oc project <project-name>
  8. In the deploy directory of the latest Operator archive that you downloaded and extracted, open the operator.yaml file. Ensure that the value of the spec.containers.image property corresponds to version 0.19 of the Operator, as shown below.

    spec:
        template:
            spec:
                containers:
                #image: registry.redhat.io/amq7/amq-broker-rhel7-operator:0.19
                image: registry.redhat.io/amq7/amq-broker-rhel7-operator@sha256:08cdeab3639b5c2ea5b0bd4de302ff01f2252ba9605f1b8b36f8a0dbd043e084
    Note

    As shown above, the Operator uses an image that is represented by a Secure Hash Algorithm (SHA) value. The comment line, which begins with a number sign (#) symbol, denotes that the SHA value corresponds to a specific container image tag. Observe that the corresponding container image tag is a floating tag in the form of 0.19. If the value of the imagePullPolicy property is also set to Always, the floating tag means that the Operator can automatically pull and use a new micro image version (that is, 0.19-n, where n is the latest micro version) when it becomes available from Red Hat.

  9. Open the operator.yaml file for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the new operator.yaml configuration file.

    Note

    The operator.yaml file for version 0.18 of the Operator includes environment variables whose names begin with BROKER_IMAGE. Do not replicate these environment variables in your new configuration. The latest version of the Operator for AMQ Broker 7.8 no longer uses these environment variables.

  10. If you have made any updates to the new operator.yaml file, save the file.
  11. Apply the updated Operator configuration.

    $ oc apply -f deploy/operator.yaml

    OpenShift updates your project to use the latest Operator version.

  12. To recreate your previous broker deployment, deploy a new instance of the main broker CR in your project. For more information, see Section 3.4.1, “Deploying a basic broker instance”.

6.2.3. Upgrading version 0.17 of the Operator

This procedure shows to how to use the OpenShift command-line interface (CLI) to upgrade version 0.17 of the Operator (that is, the latest version available for AMQ Broker 7.7) to the latest version for AMQ Broker 7.8.

Procedure

  1. In your web browser, navigate to the Software Downloads page for AMQ Broker 7.8.1 patches.
  2. Ensure that the value of the Version drop-down list is set to 7.8.1 and the Patches tab is selected.
  3. Next to AMQ Broker 7.8.1 .2 Operator Installation and Example Files, click Download.

    Download of the amq-broker-operator-7.8.1-ocp-install-examples.zip compressed archive automatically begins.

  4. When the download has completed, move the archive to your chosen installation directory. The following example moves the archive to a directory called ~/broker/operator.

    mkdir ~/broker/operator
    mv amq-broker-operator-7.8.1-ocp-install-examples.zip ~/broker/operator
  5. In your chosen installation directory, extract the contents of the archive. For example:

    cd ~/broker/operator
    unzip amq-broker-operator-7.8.1-ocp-install-examples.zip
  6. Log in to OpenShift Container Platform as a cluster administrator. For example:

    $ oc login -u system:admin
  7. Switch to the OpenShift project in which you want to upgrade your Operator version.

    $ oc project <project-name>
  8. Delete the main broker Custom Resource (CR) instance in your project. This also deletes the broker deployment. For example:

    $ oc delete -f deploy/crs/broker_activemqartemis_cr.yaml
  9. Update the main broker Custom Resource Definition (CRD) in your OpenShift cluster to the latest version.

    $ oc apply -f deploy/crds/broker_activemqartemis_crd.yaml
    Note

    You do not need to update your cluster with the latest versions of the CRDs for addressing or the scaledown controller. These CRDs are fully compatible with the ones included with the previous Operator version.

  10. In the deploy directory of the latest Operator archive that you downloaded and extracted, open the operator.yaml file. Ensure that the value of the spec.containers.image property corresponds to version 0.19 of the Operator, as shown below.

    spec:
        template:
            spec:
                containers:
                #image: registry.redhat.io/amq7/amq-broker-rhel7-operator:0.19
                image: registry.redhat.io/amq7/amq-broker-rhel7-operator@sha256:08cdeab3639b5c2ea5b0bd4de302ff01f2252ba9605f1b8b36f8a0dbd043e084
    Note

    As shown above, the Operator uses an image that is represented by a Secure Hash Algorithm (SHA) value. The comment line, which begins with a number sign (#) symbol, denotes that the SHA value corresponds to a specific container image tag. Observe that the corresponding container image tag is a floating tag in the form of 0.19. If the value of the imagePullPolicy property is also set to Always, the floating tag means that the Operator can automatically pull and use a new micro image version (that is, 0.19-n, where n is the latest micro version) when it becomes available from Red Hat.

  11. Open the operator.yaml file for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the new operator.yaml configuration file.

    Note

    The operator.yaml file for version 0.17 of the Operator includes environment variables whose names begin with BROKER_IMAGE. Do not replicate these environment variables in your new configuration. The latest version of the Operator for AMQ Broker 7.8 no longer uses these environment variables.

  12. If you have made any updates to the new operator.yaml file, save the file.
  13. Apply the updated Operator configuration.

    $ oc apply -f deploy/operator.yaml

    OpenShift updates your project to use the latest Operator version.

  14. To recreate your previous broker deployment, deploy a new instance of the main broker CR in your project. For more information, see Section 3.4.1, “Deploying a basic broker instance”.

6.2.4. Upgrading version 0.15 of the Operator

This procedure shows to how to use the OpenShift command-line interface (CLI) to upgrade version 0.15 of the Operator (that is, the first version available for AMQ Broker 7.7) to the latest version for AMQ Broker 7.8.

Procedure

  1. In your web browser, navigate to the Software Downloads page for AMQ Broker 7.8.1 patches.
  2. Ensure that the value of the Version drop-down list is set to 7.8.1 and the Patches tab is selected.
  3. Next to AMQ Broker 7.8.1 .2 Operator Installation and Example Files, click Download.

    Download of the amq-broker-operator-7.8.1-ocp-install-examples.zip compressed archive automatically begins.

  4. When the download has completed, move the archive to your chosen installation directory. The following example moves the archive to a directory called ~/broker/operator.

    mkdir ~/broker/operator
    mv amq-broker-operator-7.8.1-ocp-install-examples.zip ~/broker/operator
  5. In your chosen installation directory, extract the contents of the archive. For example:

    cd ~/broker/operator
    unzip amq-broker-operator-7.8.1-ocp-install-examples.zip
  6. Log in to OpenShift Container Platform as a cluster administrator. For example:

    $ oc login -u system:admin
  7. Switch to the OpenShift project in which you want to upgrade your Operator version.

    $ oc project <project-name>
  8. Delete the main broker Custom Resource (CR) instance in your project. This also deletes the broker deployment. For example:

    $ oc delete -f deploy/crs/broker_activemqartemis_cr.yaml
  9. Update the main broker Custom Resource Definition (CRD) in your OpenShift cluster to the latest version.

    $ oc apply -f deploy/crds/broker_activemqartemis_crd.yaml
    Note

    You do not need to update your cluster with the latest versions of the CRDs for addressing or the scaledown controller. These CRDs are fully compatible with the ones included with the previous Operator version.

  10. In the deploy directory of the latest Operator archive that you downloaded and extracted, open the operator.yaml file. Ensure that the value of the spec.containers.image property corresponds to version 0.19 of the Operator, as shown below.

    spec:
        template:
            spec:
                containers:
                #image: registry.redhat.io/amq7/amq-broker-rhel7-operator:0.19
                image: registry.redhat.io/amq7/amq-broker-rhel7-operator@sha256:08cdeab3639b5c2ea5b0bd4de302ff01f2252ba9605f1b8b36f8a0dbd043e084
    Note

    As shown above, the Operator uses an image that is represented by a Secure Hash Algorithm (SHA) value. The comment line, which begins with a number sign (#) symbol, denotes that the SHA value corresponds to a specific container image tag. Observe that the corresponding container image tag is a floating tag in the form of 0.19. If the value of the imagePullPolicy property is also set to Always, the floating tag means that the Operator can automatically pull and use a new micro image version (that is, 0.19-n, where n is the latest micro version) when it becomes available from Red Hat.

  11. Open the operator.yaml file for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the new operator.yaml configuration file.

    Note

    The operator.yaml file for version 0.15 of the Operator includes environment variables whose names begin with BROKER_IMAGE. Do not replicate these environment variables in your new configuration. The latest version of the Operator for AMQ Broker 7.8 no longer uses these environment variables.

  12. If you have made any updates to the new operator.yaml file, save the file.
  13. Apply the updated Operator configuration.

    $ oc apply -f deploy/operator.yaml

    OpenShift updates your project to use the latest Operator version.

  14. To recreate your previous broker deployment, deploy a new instance of the main broker CR in your project. For more information, see Section 3.4.1, “Deploying a basic broker instance”.

6.2.5. Upgrading version 0.13 of the Operator

This procedure shows to how to use the OpenShift command-line interface (CLI) to upgrade version 0.13 of the Operator (that is, the version available for AMQ Broker 7.6) to the latest version for AMQ Broker 7.8.

Procedure

  1. In your web browser, navigate to the Software Downloads page for AMQ Broker 7.8.1 patches.
  2. Ensure that the value of the Version drop-down list is set to 7.8.1 and the Patches tab is selected.
  3. Next to AMQ Broker 7.8.1 .2 Operator Installation and Example Files, click Download.

    Download of the amq-broker-operator-7.8.1-ocp-install-examples.zip compressed archive automatically begins.

  4. When the download has completed, move the archive to your chosen installation directory. The following example moves the archive to a directory called ~/broker/operator.

    mkdir ~/broker/operator
    mv amq-broker-operator-7.8.1-ocp-install-examples.zip ~/broker/operator
  5. In your chosen installation directory, extract the contents of the archive. For example:

    cd ~/broker/operator
    unzip amq-broker-operator-7.8.1-ocp-install-examples.zip
  6. Log in to OpenShift Container Platform as a cluster administrator. For example:

    $ oc login -u system:admin
  7. Switch to the OpenShift project in which you want to upgrade your Operator version.

    $ oc project <project-name>
  8. Delete the main broker Custom Resource (CR) instance in your project. This also deletes the broker deployment. For example:

    $ oc delete -f deploy/crs/broker_activemqartemis_cr.yaml
  9. Update the main broker Custom Resource Definition (CRD) in your OpenShift cluster to the latest version.

    $ oc apply -f deploy/crds/broker_activemqartemis_crd.yaml
  10. Update the address CRD in your OpenShift cluster to the latest version included with AMQ Broker 7.8.

    $ oc apply -f deploy/crds/broker_activemqartemisaddress_crd.yaml
    Note

    You do not need to update your cluster with the latest version of the CRD for the scaledown controller. In AMQ Broker 7.8, this CRD is fully compatible with the one that was included with the Operator for AMQ Broker 7.6.

  11. In the deploy directory of the latest Operator archive that you downloaded and extracted, open the operator.yaml file. Ensure that the value of the spec.containers.image property corresponds to version 0.19 of the Operator, as shown below.

    spec:
        template:
            spec:
                containers:
                #image: registry.redhat.io/amq7/amq-broker-rhel7-operator:0.19
                image: registry.redhat.io/amq7/amq-broker-rhel7-operator@sha256:08cdeab3639b5c2ea5b0bd4de302ff01f2252ba9605f1b8b36f8a0dbd043e084
    Note

    As shown above, the Operator uses an image that is represented by a Secure Hash Algorithm (SHA) value. The comment line, which begins with a number sign (#) symbol, denotes that the SHA value corresponds to a specific container image tag. Observe that the corresponding container image tag is a floating tag in the form of 0.19. If the value of the imagePullPolicy property is also set to Always, the floating tag means that the Operator can automatically pull and use a new micro image version (that is, 0.19-n, where n is the latest micro version) when it becomes available from Red Hat.

  12. Open the operator.yaml file for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the new operator.yaml configuration file.
  13. If you have made any updates to the new operator.yaml file, save the file.
  14. Apply the updated Operator configuration.

    $ oc apply -f deploy/operator.yaml

    OpenShift updates your project to use the latest Operator version.

6.2.6. Upgrading version 0.9 of the Operator

The following procedure shows how to use the OpenShift command-line interface (CLI) to upgrade version 0.9 of the Operator (that is, the version available for AMQ Broker 7.5 or the Long Term Support version available for AMQ Broker 7.4) to the latest version for AMQ Broker 7.8.

Procedure

  1. In your web browser, navigate to the Software Downloads page for AMQ Broker 7.8.1 patches.
  2. Ensure that the value of the Version drop-down list is set to 7.8.1 and the Patches tab is selected.
  3. Next to AMQ Broker 7.8.1 .2 Operator Installation and Example Files, click Download.

    Download of the amq-broker-operator-7.8.1-ocp-install-examples.zip compressed archive automatically begins.

  4. When the download has completed, move the archive to your chosen installation directory. The following example moves the archive to a directory called ~/broker/operator.

    mkdir ~/broker/operator
    mv amq-broker-operator-7.8.1-ocp-install-examples.zip ~/broker/operator
  5. In your chosen installation directory, extract the contents of the archive. For example:

    cd ~/broker/operator
    unzip amq-broker-operator-7.8.1-ocp-install-examples.zip
  6. Log in to OpenShift Container Platform as a cluster administrator. For example:

    $ oc login -u system:admin
  7. Switch to the OpenShift project in which you want to upgrade your Operator version.

    $ oc project <project-name>
  8. Delete the main broker Custom Resource (CR) instance in your project. This also deletes the broker deployment. For example:

    $ oc delete -f deploy/crs/broker_v2alpha1_activemqartemis_cr.yaml
  9. Update the main broker Custom Resource Definition (CRD) in your OpenShift cluster to the latest version included with AMQ Broker 7.8.

    $ oc apply -f deploy/crds/broker_activemqartemis_crd.yaml
  10. Update the address CRD in your OpenShift cluster to the latest version included with AMQ Broker 7.8.

    $ oc apply -f deploy/crds/broker_activemqartemisaddress_crd.yaml
    Note

    You do not need to update your cluster with the latest version of the CRD for the scaledown controller. In AMQ Broker 7.8, this CRD is fully compatible with the one included with the previous Operator version.

  11. In the deploy directory of the latest Operator archive that you downloaded and extracted, open the operator.yaml file. Ensure that the value of the spec.containers.image property corresponds to version 0.19 of the Operator, as shown below.

    spec:
        template:
            spec:
                containers:
                #image: registry.redhat.io/amq7/amq-broker-rhel7-operator:0.19
                image: registry.redhat.io/amq7/amq-broker-rhel7-operator@sha256:08cdeab3639b5c2ea5b0bd4de302ff01f2252ba9605f1b8b36f8a0dbd043e084
    Note

    As shown above, the Operator uses an image that is represented by a Secure Hash Algorithm (SHA) value. The comment line, which begins with a number sign (#) symbol, denotes that the SHA value corresponds to a specific container image tag. Observe that the corresponding container image tag is a floating tag in the form of 0.19. If the value of the imagePullPolicy property is also set to Always, the floating tag means that the Operator can automatically pull and use a new micro image version (that is, 0.19-n, where n is the latest micro version) when it becomes available from Red Hat.

  12. Open the operator.yaml file for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the new operator.yaml configuration file.
  13. If you have made any updates to the new operator.yaml file, save the file.
  14. Apply the updated Operator configuration.

    $ oc apply -f deploy/operator.yaml

    OpenShift updates your project to use the latest Operator version.

  15. To recreate your previous broker deployment, deploy a new instance of the main broker CR in your project. For more information, see Section 3.4.1, “Deploying a basic broker instance”.

6.3. Upgrading the Operator using OperatorHub

This section describes how to use OperatorHub to upgrade different versions of the Operator to the latest version available for AMQ Broker 7.8.

6.3.1. Prerequisites

  • You should use OperatorHub to upgrade the Operator only if you originally used OperatorHub to install the Operator (that is, the Operator appears under OperatorsInstalled Operators for your project in the OpenShift Container Platform web console). By contrast, if you originally used the OpenShift command-line interface (CLI) to install the Operator, you should also use the CLI to upgrade the Operator. To learn how to upgrade the Operator using the CLI, see Section 6.2, “Upgrading the Operator using the CLI”.
  • Upgrading the AMQ Broker Operator using OperatorHub requires cluster administrator privileges for your OpenShift cluster.

6.3.2. Before you begin

This section describes some important considerations before you use OperatorHub to upgrade an instance of the AMQ Broker Operator.

  • The Operator Lifecycle Manager automatically updates the CRDs in your OpenShift cluster when you install the latest Operator version from OperatorHub. You do not need to remove existing CRDs.
  • When you update your cluster with the CRDs for the latest Operator version, this update affects all projects in the cluster. Any broker Pods deployed from previous versions of the Operator might become unable to update their status in the OpenShift Container Platform web console. When you click the Logs tab of a running broker Pod, you see messages indicating that 'UpdatePodStatus' has failed. However, the broker Pods and Operator in that project continue to work as expected. To fix this issue for an affected project, you must also upgrade that project to use the latest version of the Operator.

6.3.3. Upgrading the Operator using OperatorHub

This procedure shows how to use OperatorHub to upgrade an instance of the AMQ Broker Operator.

Procedure

  1. Log in to the OpenShift Container Platform web console as a cluster administrator.
  2. Delete the main Custom Resource (CR) instance for the broker deployment in your project. This action deletes the broker deployment.

    1. In the left navigation menu, click AdministrationCustom Resource Definitions.
    2. On the Custom Resource Definitions page, click the ActiveMQArtemis CRD.
    3. Click the Instances tab.
    4. Locate the CR instance that corresponds to your project namespace.
    5. For your CR instance, click the More Options icon (three vertical dots) on the right-hand side. Select Delete ActiveMQArtemis.
  3. Uninstall the existing AMQ Broker Operator from your project.

    1. In the left navigation menu, click OperatorsInstalled Operators.
    2. From the Project drop-down menu at the top of the page, select the project in which you want to uninstall the Operator.
    3. Locate the Red Hat Integration - AMQ Broker instance that you want to uninstall.
    4. For your Operator instance, click the More Options icon (three vertical dots) on the right-hand side. Select Uninstall Operator.
    5. On the confirmation dialog box, click Uninstall.
  4. Use OperatorHub to install the latest version of the Operator for AMQ Broker 7.8. For more information, see Section 3.3.3, “Deploying the Operator from OperatorHub”.
  5. To recreate your previous broker deployment, deploy a new instance of the main broker CR in your project. For more information, see Section 3.4.1, “Deploying a basic broker instance”.

6.4. Upgrading the broker container image by specifying an AMQ Broker version

The following procedure shows how to upgrade the broker container image for an Operator-based broker deployment by specifying an AMQ Broker version. You might do this, for example, if you upgrade the Operator to the latest version for AMQ Broker 7.8.1 but the spec.upgrades.enabled property in your CR is already set to true and the spec.version property specifies 7.7.0 or 7.8.0. To upgrade the broker container image, you need to manually specify a new AMQ Broker version (for example, 7.8.1). When you specify a new version of AMQ Broker, the Operator automatically chooses the broker container image that corresponds to this version.

Prerequisites

Procedure

  1. Edit the main broker CR instance for the broker deployment.

    1. Using the OpenShift command-line interface:

      1. Log in to OpenShift as a user that has privileges to edit and deploy CRs in the project for the broker deployment.

        $ oc login -u <user> -p <password> --server=<host:port>
      2. In a text editor, open the CR file that you used for your broker deployment. For example, this might be the broker_activemqartemis_cr.yaml file that was included in the deploy/crs directory of the Operator installation archive that you previously downloaded and extracted.
    2. Using the OpenShift Container Platform web console:

      1. Log in to the console as a user that has privileges to edit and deploy CRs in the project for the broker deployment.
      2. In the left pane, click AdministrationCustom Resource Definitions.
      3. Click the ActiveMQArtemis CRD.
      4. Click the Instances tab.
      5. Locate the CR instance that corresponds to your project namespace.
      6. For your CR instance, click the More Options icon (three vertical dots) on the right-hand side. Select Edit ActiveMQArtemis.

        Within the console, a YAML editor opens, enabling you to edit the CR instance.

  2. To specify a version of AMQ Broker to which to upgrade the broker container image, set a value for the spec.version property of the CR. For example:

    spec:
        version: 7.8.1
        ...
  3. In the spec section of the CR, locate the upgrades section. If this section is not already included in the CR, add it.

    spec:
        version: 7.8.1
        ...
        upgrades:
  4. Ensure that the upgrades section includes the enabled and minor properties.

    spec:
        version: 7.8.1
        ...
        upgrades:
            enabled:
            minor:
  5. To enable an upgrade of the broker container image based on a specified version of AMQ Broker, set the value of the enabled property to true.

    spec:
        version: 7.8.1
        ...
        upgrades:
            enabled: true
            minor:
  6. To define the upgrade behavior of the broker, set a value for the minor property.

    1. To allow upgrades between minor AMQ Broker versions, set the value of minor to true.

      spec:
          version: 7.8.1
          ...
          upgrades:
              enabled: true
              minor: true

      For example, suppose that the current broker container image corresponds to 7.7.0, and a new image, corresponding to the 7.8.1 version specified for spec.version, is available. In this case, the Operator determines that there is an available upgrade between the 7.7 and 7.8 minor versions. Based on the preceding settings, which allow upgrades between minor versions, the Operator upgrades the broker container image.

      By contrast, suppose that the current broker container image corresponds to 7.8.0, and a new image, corresponding to the 7.8.1 version specified for spec.version, is available. In this case, the Operator determines that there is an available upgrade between 7.8.0 and 7.8.1 micro versions. Based on the preceding settings, which allow upgrades only between minor versions, the Operator does not upgrade the broker container image.

    2. To allow upgrades between micro AMQ Broker versions, set the value of minor to false.

      spec:
          version: 7.8.1
          ...
          upgrades:
              enabled: true
              minor: false

      For example, suppose that the current broker container image corresponds to 7.7.0, and a new image, corresponding to the 7.8.1 version specified for spec.version, is available. In this case, the Operator determines that there is an available upgrade between the 7.7 and 7.8 minor versions. Based on the preceding settings, which do not allow upgrades between minor versions (that is, only between micro versions), the Operator does not upgrade the broker container image.

      By contrast, suppose that the current broker container image corresponds to 7.8.0, and a new image, corresponding to the 7.8.1 version specified for spec.version, is available. In this case, the Operator determines that there is an available upgrade between 7.8.0 and 7.8.1 micro versions. Based on the preceding settings, which allow upgrades between micro versions, the Operator upgrades the broker container image.

  7. Apply the changes to the CR.

    1. Using the OpenShift command-line interface:

      1. Save the CR file.
      2. Switch to the project for the broker deployment.

        $ oc project <project_name>
      3. Apply the CR.

        $ oc apply -f <path/to/broker_custom_resource_instance>.yaml
    2. Using the OpenShift web console:

      1. When you have finished editing the CR, click Save.

    When you apply the CR change, the Operator first validates that an upgrade to the AMQ Broker version specified for spec.version is available for your existing deployment. If you have specified an invalid version of AMQ Broker to which to upgrade (for example, a version that is not yet available), the Operator logs a warning message, and takes no further action.

    However, if an upgrade to the specified version is available, and the values specified for upgrades.enabled and upgrades.minor allow the upgrade, then the Operator upgrades each broker in the deployment to use the broker container image that corresponds to the new AMQ Broker version.

    The broker container image that the Operator uses is defined in an environment variable in the operator.yaml configuration file of the Operator deployment. The environment variable name includes an identifier for the AMQ Broker version. For example, the environment variable RELATED_IMAGE_ActiveMQ_Artemis_Broker_Kubernetes_781 corrsponds to AMQ Broker 7.8.1.

    When the Operator has applied the CR change, it restarts each broker Pod in your deployment so that each Pod uses the specified image version. If you have multiple brokers in your deployment, only one broker Pod shuts down and restarts at a time.

Additional resources