Chapter 6. Upgrading an Operator-based broker deployment
Upgrading an Operator-based broker deployment involves upgrading the Operator and broker container images.
6.1. Before you begin Copy linkLink copied to clipboard!
This section describes some important considerations before you upgrade the Operator and broker container images for an Operator-based broker deployment.
Upgrade the Operator and the broker images in two separate steps, beginning with the Operator upgrade, to ensure that the upgrade runs smoothly.
To separate the upgrade of the broker images from the Operator upgrade, you must prevent the upgraded Operator from automatically upgrading the broker container images to the latest version supported by the new Operator. You can prevent this automatic upgrade by setting the
versionattribute in the CR. For example, you can set the value of theversionattribute to the version of the broker images currently deployed, which is displayed in thestatussection of the CR. For more information, see Section 6.6.1, “Restricting automatic upgrades of images by using version numbers”.- 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
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: If the
redeliveryDelayMultiplierand theredeliveryCollisionAvoidanceFactorattributes are configured in the main broker CR in a 7.8.x or 7.9.x deployment, the new Operator is unable to reconcile any CR after you upgrade to 7.10.x or later. The reconcile fails because the data type of both attributes changed from float to string in 7.10.x.You can work around this issue by deleting the
redeliveryDelayMultiplierand theredeliveryCollisionAvoidanceFactorattributes from thespec.deploymentPlan.addressSettings.addressSettingattribute. Then, configure the attributes under thebrokerPropertiesattribute. For example:spec: ... brokerProperties: - "addressSettings.#.redeliveryMultiplier=2.1" - "addressSettings.#.redeliveryCollisionAvoidanceFactor=1.2"spec: ... brokerProperties: - "addressSettings.#.redeliveryMultiplier=2.1" - "addressSettings.#.redeliveryCollisionAvoidanceFactor=1.2"Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteUnder the
brokerPropertiesattribute, use theredeliveryMultiplierattribute name instead of theredeliveryDelayMultiplierattribute name that you deleted.
6.2. Automatic Operator upgrades Copy linkLink copied to clipboard!
If you used OperatorHub to install the Operator and you used the default value of Automatic for the Update Approval option in the Install Operator page, OperatorHub automatically upgrades the Operator to each new version that has the same micro version as the current Operator. For example, if the current Operator version is 7.11.6, OperatorHub automatically upgrades the Operator to version 7.11.7.
Automatic upgrades between minor Operator versions are not supported. For example, if the current Operator is version 7.11.7, an automatic upgrade to version 7.12.x is not possible. To upgrade between minor versions of the Operator, you must manually uninstall the current Operator and install the new Operator from the channel where Operators for that minor version are made available. You can manually upgrade between minor versions of the Operator by using OperatorHub or the OpenShift command-line interface (CLI).
Uninstalling the Operator has no effect on the brokers that are managed by the Operator provided that you do not select the Delete all operand instances for this operator checkbox during the uninstall procedure. For more information, see Section 6.3.2, “Upgrading the Operator”.
6.3. Manually upgrading the Operator using OperatorHub Copy linkLink copied to clipboard!
Use OperatorHub to upgrade the Operator only if you originally used OperatorHub to install the Operator (that is, the Operator appears under
If you are upgrading from 7.10.0 or 7.10.1, see the specific sections that describe how to complete the upgrade of these versions of the Operator.
6.3.1. Before you begin Copy linkLink copied to clipboard!
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 must not remove existing CRDs. If you remove existing CRDs, all CRs and broker instances are also removed.
- 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.
If you are upgrading from 7.10.0 or 7.10.1, see the specific sections that describe how to complete the upgrade of these versions of the Operator. Upgrading these versions requires additional steps to prevent the Operator upgrade from restarting the broker pods in the deployment.
6.3.2. Upgrading the Operator Copy linkLink copied to clipboard!
You must uninstall the current Operator and install the new Operator to complete the upgrade.
Procedure
- Log in to the OpenShift Container Platform web console as a cluster administrator.
- Uninstall the existing AMQ Broker Operator from your project.
-
In the left navigation menu, click
. - From the Project drop-down menu at the top of the page, select the project in which you want to uninstall the Operator.
- Locate the Red Hat Integration - AMQ Broker instance that you want to uninstall.
For your Operator instance, click the More Options icon (three vertical dots) on the right-hand side. Select Uninstall Operator.
WarningEnsure that the Delete all operand instances for this operator checkbox is NOT selected. If this checkbox is selected, the broker instances that are managed by the Operator are deleted when the Operator is uninstalled.
- On the confirmation dialog box, click Uninstall.
- Use OperatorHub to install the latest version of the Operator for AMQ Broker 7.12. For more information, see Section 3.3.2, “Deploying the Operator from OperatorHub”.
-
In the left navigation menu, click
. - Verify that the correct version number is displayed under the Red Hat Integration - AMQ Broker instance that is installed.
6.3.3. Upgrading the Operator from 7.10.0 Copy linkLink copied to clipboard!
You must uninstall the 7.10.0 Operator and install the new Operator to complete the upgrade. This procedure includes additional steps to prevent the new Operator from restarting the broker pods in the deployment, which causes an outage.
Procedure
- Log in to the OpenShift Container Platform web console as a cluster administrator.
Uninstall the existing AMQ Broker Operator from your project.
-
In the left navigation menu, click
. - From the Project drop-down menu at the top of the page, select the project in which you want to uninstall the Operator.
- Locate the Red Hat Integration - AMQ Broker instance that you want to uninstall.
- For your Operator instance, click the More Options icon (three vertical dots) on the right-hand side. Select Uninstall Operator.
- On the confirmation dialog box, click Uninstall.
-
In the left navigation menu, click
When you upgrade a 7.10.0 Operator, the new Operator deletes the StatefulSet to remove custom and Operator metering labels, which were incorrectly added to the StatefulSet selector by the Operator in 7.10.0. When the Operator deletes the StatefulSet, it also deletes the existing broker pods, which causes a temporary broker outage. If you want to avoid the outage, complete the following steps to delete the StatefulSet and orphan the broker pods so that they continue to run.
Log in to OpenShift Container Platform CLI as an administrator for the project that contains your existing Operator deployment:
oc login -u <user>
$ oc login -u <user>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Switch to the OpenShift project in which you want to upgrade your Operator version.
oc project <project-name>
$ oc project <project-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the StatefulSet with the
--cascade=orphanoption to orphan the broker pods. The orphaned broker pods continue to run after the StatefulSet is deleted.oc delete statefulset <statefulset-name> --cascade=orphan
$ oc delete statefulset <statefulset-name> --cascade=orphanCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Check if your main broker CR has labels called
applicationorActiveMQArtemisconfigured in thedeploymentPlan.labelsattribute.In 7.10.0, it was possible to configure these custom labels in the CR. These labels are reserved for the Operator to assign labels to pods and cannot be added as custom labels after 7.10.0. If these custom labels were configured in the main broker CR in 7.10.0, the Operator-assigned labels on the pods were overwritten by the custom labels. If the CR has either of these labels, complete the following steps to restore the correct labels on the pods and remove the labels from the CR.
In the OpenShift command-line interface (CLI), run the following command to restore the correct pod labels. In the following example, 'ex-aao' is the name of the StatefulSet deployed.
for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; done
$ for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the
applicationandActiveMQArtemislabels from thedeploymentPlan.labelsattribute in the CR.Using the OpenShift command-line interface:
Log in to OpenShift as a user that has privileges to deploy CRs in the project for the broker deployment.
oc login -u <user> -p <password> --server=<host:port>
oc login -u <user> -p <password> --server=<host:port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CR for your deployment.
oc edit ActiveMQArtemis <statefulset name> -n <namespace>
oc edit ActiveMQArtemis <statefulset name> -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
In the
deploymentPlan.labelselement in the CR, delete any custom labels calledapplicationorActiveMQArtemis. - Save the CR.
Using the OpenShift Container Platform web console:
- Log in to the console as a user that has privileges to deploy CRs in the project for the broker deployment.
-
In the left pane, click
. - Click the ActiveMQArtemis CRD.
- Click the Instances tab.
- Click the instance for your broker deployment.
Click the YAML tab.
Within the console, a YAML editor opens, enabling you to configure a CR instance.
-
In the
deploymentPlan.labelselement in the CR, delete any custom labels calledapplicationorActiveMQArtemis. - Click Save.
Use OperatorHub to install the latest version of the Operator for AMQ Broker 7.12. For more information, see Section 3.3.2, “Deploying the Operator from OperatorHub”.
The new Operator can recognize and manage your previous broker deployments. If you set values in the
imageorversionfield in the CR, the Operator’s reconciliation process upgrades the broker pods to the corresponding images when the Operator starts. For more information, see Section 6.6, “Restricting automatic upgrades of broker container images”. Otherwise, the Operator upgrades each broker pod to the latest container image.NoteIf the reconciliation process does not start, you can start the process by scaling the deployment. For more information, see Section 3.4.1, “Deploying a basic broker instance”.
- Add attributes to the CR for the new features that are available in the upgraded broker, as required.
6.3.4. Upgrading the Operator from 7.10.1 Copy linkLink copied to clipboard!
You must uninstall the 7.10.1 Operator and install the new Operator to complete the upgrade. This procedure includes additional steps that you might need to complete, depending on your configuration, to prevent the new Operator from restarting the broker pods, which causes an outage.
Procedure
- Log in to the OpenShift Container Platform web console as a cluster administrator.
Check if your main broker CR has labels called
applicationorActiveMQArtemisconfigured in thedeploymentPlan.labelsattribute.These labels are reserved for the Operator to assign labels to pods and cannot be used after 7.10.1. If these custom labels were configured in the main broker CR, the Operator-assigned labels on the pods were overwritten by the custom labels.
- If these custom labels are not configured in the main broker CR, use OperatorHub to install the latest version of the Operator for AMQ Broker 7.12. For more information, see Section 3.3.2, “Deploying the Operator from OperatorHub”.
If either of these custom labels are configured in the main broker CR, complete the following steps to uninstall the existing Operator, restore the correct pod labels and remove the labels from the CR, before you install the new Operator.
NoteBy uninstalling the Operator, you can remove the custom labels without the Operator deleting the StatefulSet, which also deletes the existing broker pods and causes a temporary broker outage.
Uninstall the existing AMQ Broker Operator from your project.
-
In the left navigation menu, click
. - From the Project drop-down menu at the top of the page, select the project from which you want to uninstall the Operator.
- Locate the Red Hat Integration - AMQ Broker instance that you want to uninstall.
- For your Operator instance, click the More Options icon (three vertical dots) on the right-hand side. Select Uninstall Operator.
- On the confirmation dialog box, click Uninstall.
-
In the left navigation menu, click
In the OpenShift command-line interface (CLI), run the following command to restore the correct pod labels. In the following example, 'ex-aao' is the name of the StatefulSet deployed.
for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; done
$ for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the
applicationandActiveMQArtemislabels from thedeploymentPlan.labelsattribute in the CR.Using the OpenShift command-line interface:
Log in to OpenShift as a user that has privileges to deploy CRs in the project for the broker deployment.
oc login -u <user> -p <password> --server=<host:port>
oc login -u <user> -p <password> --server=<host:port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CR for your deployment.
oc edit ActiveMQArtemis <statefulset name> -n <namespace>
oc edit ActiveMQArtemis <statefulset name> -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
In the
deploymentPlan.labelsattribute in the CR, delete any custom labels calledapplicationorActiveMQArtemis. - Save the CR file.
Using the OpenShift Container Platform web console:
- Log in to the console as a user that has privileges to deploy CRs in the project for the broker deployment.
-
In the left pane, click
. - Click the ActiveMQArtemis CRD.
- Click the Instances tab.
- Click the instance for your broker deployment.
Click the YAML tab.
Within the console, a YAML editor opens, enabling you to configure a CR instance.
-
In the
deploymentPlan.labelsattribute in the CR, delete any custom labels calledapplicationorActiveMQArtemis. - Click Save.
Use OperatorHub to install the latest version of the Operator for AMQ Broker 7.12. For more information, see Section 3.3.2, “Deploying the Operator from OperatorHub”.
The new Operator can recognize and manage your previous broker deployments. If you set values in the
imageorversionfield in the CR, the Operator’s reconciliation process upgrades the broker pods to the corresponding images when the Operator starts. For more information, see Section 6.6, “Restricting automatic upgrades of broker container images”. Otherwise, the Operator upgrades each broker pod to the latest container image.NoteIf the reconciliation process does not start, you can start the process by scaling the deployment. For more information, see Section 3.4.1, “Deploying a basic broker instance”.
- Add attributes to the CR for the new features that are available in the upgraded broker, as required.
6.4. Manually upgrading the Operator using the CLI Copy linkLink copied to clipboard!
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.12.
6.4.1. Prerequisites Copy linkLink copied to clipboard!
-
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
for your project in the OpenShift Container Platform web console), use OperatorHub to upgrade the Operator. To learn how to upgrade the Operator using OperatorHub, see Section 6.3, “Manually upgrading the Operator using OperatorHub”.
6.4.2. Upgrading the Operator using the CLI Copy linkLink copied to clipboard!
You can use the OpenShift command-line interface (CLI) to upgrade the Operator to the latest version for AMQ Broker 7.12.
Procedure
- In your web browser, navigate to the Software Downloads page for AMQ Broker 7.12.6.
-
Ensure that the value of the Version drop-down list is set to
7.12.6and the Releases tab is selected. Next to AMQ Broker 7.12.6 Operator Installation and Example Files, click Download.
Download of the
amq-broker-operator-7.12.6-ocp-install-examples-rhel8.zipcompressed archive automatically begins.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.12.6-ocp-install-examples-rhel8.zip ~/broker/operator
$ mkdir ~/broker/operator $ mv amq-broker-operator-7.12.6-ocp-install-examples-rhel8.zip ~/broker/operatorCopy to Clipboard Copied! Toggle word wrap Toggle overflow In your chosen installation directory, extract the contents of the archive. For example:
cd ~/broker/operator unzip amq-broker-operator-operator-7.12.6-ocp-install-examples-rhel8.zip
$ cd ~/broker/operator $ unzip amq-broker-operator-operator-7.12.6-ocp-install-examples-rhel8.zipCopy to Clipboard Copied! Toggle word wrap Toggle overflow Log in to OpenShift Container Platform as an administrator for the project that contains your existing Operator deployment.
oc login -u <user>
$ oc login -u <user>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Switch to the OpenShift project in which you want to upgrade your Operator version.
oc project <project-name>
$ oc project <project-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the
deploydirectory of the latest Operator archive that you downloaded and extracted, open theoperator.yamlfile.NoteIn the
operator.yamlfile, 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.-
Open the
operator.yamlfile for your previous Operator deployment. Check that any non-default values that you specified in your previous configuration are replicated in the newoperator.yamlconfiguration file. In the new
operator.yamlfile, the Operator is namedamq-broker-controller-managerby default. If the name of the Operator in your previous deployment is notamq-broker-controller-manager, replace all instances ofamq-broker-controller-managerwith the previous Operator name. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the new
operator.yamlfile, the service account for the Operator is namedamq-broker-controller-manager. In previous versions, the service account for the Operator was namedamq-broker-operator.If you want to use the service account name in your previous deployment, replace the name of the service account in the new
operator.yamlfile with the name used in the previous deployment. For example:spec: ... serviceAccountName: amq-broker-operator ...
spec: ... serviceAccountName: amq-broker-operator ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you want to use the new service account name,
amq-broker-controller-managerfor the Operator, update the service account, role, and role binding in your project.oc apply -f deploy/service_account.yaml
$ oc apply -f deploy/service_account.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f deploy/role.yaml
$ oc apply -f deploy/role.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow oc apply -f deploy/role_binding.yaml
$ oc apply -f deploy/role_binding.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Update the CRDs that are included with the Operator.
Update the main broker CRD.
oc apply -f deploy/crds/broker_activemqartemis_crd.yaml
$ oc apply -f deploy/crds/broker_activemqartemis_crd.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the address CRD.
oc apply -f deploy/crds/broker_activemqartemisaddress_crd.yaml
$ oc apply -f deploy/crds/broker_activemqartemisaddress_crd.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the scaledown controller CRD.
oc apply -f deploy/crds/broker_activemqartemisscaledown_crd.yaml
$ oc apply -f deploy/crds/broker_activemqartemisscaledown_crd.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Update the security CRD.
oc apply -f deploy/crds/broker_activemqartemissecurity_crd.yaml
$ oc apply -f deploy/crds/broker_activemqartemissecurity_crd.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you are upgrading from AMQ Broker Operator 7.10.0 only, delete the Operator and the StatefulSet.
By default, the new Operator deletes the StatefulSet to remove custom and Operator metering labels, which were incorrectly added to the StatefulSet selector by the Operator in 7.10.0. When the Operator deletes the StatefulSet, it also deletes the existing broker pods, which causes a temporary broker outage. If you want to avoid an outage, complete the following steps to delete the Operator and the StatefulSet without deleting the broker pods.
Delete the Operator.
oc delete -f deploy/operator.yaml
$ oc delete -f deploy/operator.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow NoteDeleting the Operator does not remove the broker instances that are managed by the Operator.
Delete the StatefulSet with the
--cascade=orphanoption to orphan the broker pods. The orphaned broker pods continue to run after the StatefulSet is deleted.oc delete statefulset <statefulset-name> --cascade=orphan
$ oc delete statefulset <statefulset-name> --cascade=orphanCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you are upgrading from AMQ Broker Operator 7.10.0 or 7.10.1, check if your main broker CR has labels called
applicationorActiveMQArtemisconfigured in thedeploymentPlan.labelsattribute.These labels are reserved for the Operator to assign labels to pods and are not permitted as custom labels after 7.10.1. If these custom labels were configured in the main broker CR, the Operator-assigned labels on the pods were overwritten by the custom labels. If either of these custom labels are configured in the main broker CR, complete the following steps to restore the correct labels on the pods and remove the labels from the CR.
If you are upgrading from 7.10.0, you deleted the Operator in the previous step. If you are upgrading from 7.10.1, delete the Operator.
oc delete -f deploy/operator.yaml
$ oc delete -f deploy/operator.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the following command to restore the correct pod labels. In the following example, 'ex-aao' is the name of the StatefulSet deployed.
for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; done
$ for pod in $(oc get pods | grep -o '^ex-aao[^ ]*'); do oc label --overwrite pods $pod ActiveMQArtemis=ex-aao application=ex-aao-app; doneCopy to Clipboard Copied! Toggle word wrap Toggle overflow Delete the
applicationandActiveMQArtemislabels from thedeploymentPlan.labelsattribute in the CR.Log in to OpenShift as a user that has privileges to deploy CRs in the project for the broker deployment.
oc login -u <user> -p <password> --server=<host:port>
oc login -u <user> -p <password> --server=<host:port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Open the sample CR file called
broker_activemqartemis_cr.yamlthat was included in thedeploy/crsdirectory of the Operator installation archive that you downloaded and extracted. -
In the
deploymentPlan.labelsattribute in the CR, delete any custom labels calledapplicationorActiveMQArtemis. - Save the CR file.
Deploy the CR instance.
Switch to the project for the broker deployment.
oc project <project_name>
$ oc project <project_name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Apply the CR.
oc apply -f <path/to/broker_custom_resource_instance>.yaml
$ oc apply -f <path/to/broker_custom_resource_instance>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
If you deleted the previous Operator, deploy the new Operator.
oc create -f deploy/operator.yaml
$ oc create -f deploy/operator.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Apply the updated Operator configuration.
oc apply -f deploy/operator.yaml
$ oc apply -f deploy/operator.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow - Add attributes to the CR for the new features that are available in the upgraded broker, as required.
6.5. Upgrading broker container images Copy linkLink copied to clipboard!
After the Operator is upgraded, it can manage multiple versions of AMQ Broker. You can find the list of versions supported by the new Operator in the Operator log. For example:
INFO setup Version of the operator: 7.12.5.OPR.1 2025-07-14T15:04:17 INFO setup Supported ActiveMQArtemis Kubernetes Image Versions: 7.11.0 7.11.1 7.11.2 7.11.3 7.11.4 7.11.5 7.11.6 7.11.7 7.12.0 7.12.1 7.12.2 7.12.3 7.12.4 7.12.5
If, as recommended, you configured the version attribute in the custom resource to prevent the new Operator from automatically upgrading the broker images at the same time as the Operator upgrade, you can change the version number to upgrade the broker images. For more information, see Section 6.6, “Restricting automatic upgrades of broker container images”.
If the version attribute is not configured in the custom resource, the Operator automatically upgrades each broker it manages to the latest available version of the broker container image that the Operator supports. For a 7.12.6 Operator, the latest version of the broker container images supported is 7.12.6.
6.6. Restricting automatic upgrades of broker container images Copy linkLink copied to clipboard!
By default, the Operator automatically upgrades each broker it manages to the latest available container images that the Operator version supports. In the custom resource (CR) for your deployment, you can restrict the ability of the Operator to upgrade the images by specifying a version number or the URLs of specific container images.
6.6.1. Restricting automatic upgrades of images by using version numbers Copy linkLink copied to clipboard!
You can restrict the version of the container images to which the brokers are automatically upgraded as new versions become available.
When you restrict upgrades based on version numbers, the Operator continues to automatically upgrade the brokers to use any new images that contain security fixes for the version deployed.
Procedure
Edit the main broker CR instance for the broker deployment.
Using the OpenShift command-line interface:
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>
$ oc login -u <user> -p <password> --server=<host:port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CR.
oc edit ActiveMQArtemis <CR instance name> -n <namespace>
oc edit ActiveMQArtemis <CR instance name> -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Using the OpenShift Container Platform web console:
- Log in to the console as a user that has privileges to deploy CRs in the project for the broker deployment.
-
In the left pane, click
. - Click the Red Hat Integration - AMQ Broker for RHEL 8 (Multiarch) operator.
- Click the AMQ Broker tab.
- Click the name of the ActiveMQArtemis instance name.
Click the YAML tab.
Within the console, a YAML editor opens, enabling you to edit the CR instance.
NoteIn the
statussection of the CR, the.status.version.brokerVersionfield shows the version of AMQ Broker that is currently deployed.
In the
spec.versionattribute, specify the version to which the Operator can upgrade the broker and init container images in your deployment. The following are examples of values that you can specify.- Examples
In the following example, the Operator upgrades the current container images in your deployment to 7.12.0.
spec: version: '7.12.0' ...spec: version: '7.12.0' ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the following example, the Operator upgrades the current container images in your deployment to the latest available 7.11.x images. For example, if your deployment is using 7.11.1 container images, the Operator automatically upgrades the images to 7.11.6 but not to 7.12.6.
spec: version: '7.11' ...spec: version: '7.11' ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow In the following example, the Operator upgrades the current container images in your deployment to the latest 7.x.x images. For example, if your deployment is using 7.11.6 images, the Operator automatically upgrades the images to 7.12.6.
spec: version: '7' ...spec: version: '7' ...Copy to Clipboard Copied! Toggle word wrap Toggle overflow NoteTo upgrade between minor versions of the container images, for example, from 7.11.x to 7.12.x, you require an Operator that has the same minor version as that of the new container images. For example, to upgrade from 7.11.6 to 7.12.6, a 7.12.x Operator must be installed.
- Save the CR.
If you use the spec.version attribute in the CR to restrict automatic upgrades of broker container images, ensure that the CR does not also contain a spec.deploymentPlan.image or a spec.deploymentPlan.initImage attribute. Both of these attributes override the spec.version attribute. If the CR has one of these attributes as well as the spec.version attribute, the versions of the broker and init images deployed can diverge, which might prevent the broker from running.
When you save the CR, the Operator first validates that an upgrade to the AMQ Broker version specified for spec.version is available for your existing deployment. If you 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, then the Operator upgrades each broker in the deployment to use the broker container images that correspond 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_7126 corresponds to AMQ Broker 7.12.6.
When the Operator applies 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
- To learn how the Operator uses environment variables to choose a broker container image, see Section 2.7, “How the Operator chooses container images”.
- To view the status of the deployment, see Section 2.8, “Validation of image and version configuration in a custom resource (CR)”
6.6.2. Restricting automatic upgrades of images by using image URLs Copy linkLink copied to clipboard!
If you want to upgrade the brokers in your deployment to use specific container images, you can specify the registry URLs of the images in the CR. After the Operator upgrades the brokers to the specified container images, no further upgrades occur until you replace the image URLs in the CR. For example, the Operator does not automatically upgrade the brokers to use newer images that contain security fixes for the images deployed.
If you want to restrict automatic upgrades by using image URLs, specify URLs for both the spec.deploymentPlan.image and the spec.deploymentPlan.initImage attributes in the CR to ensure that the broker and init container images match. If you specify the URL of one container image only, the broker and init container image can diverge, which might prevent the broker from running.
If a CR has a spec.version attribute in addition to spec.deploymentPlan.image and spec.deploymentPlan.initImage attributes, the Operator ignores the spec.version attribute.
Procedure
Obtain the URLs of the broker and init container images to which the Operator can upgrade the current images.
- In the Red Hat Catalog, open the broker container component page: AMQ Broker for RHEL 8 (Multiarch).
- In the Architecture drop-down, select your architecture.
- In the Tag drop-down, select the tag that corresponds to the image you want to install. Tags are displayed in chronological order based on the release date. A tag consists of the release version and an assigned tag.
- Open the Get this image tab.
- In the Manifest field, click the Copy icon.
- Paste the URL into a text file.
- In the Red Hat Catalog, open the init container component page: AMQ Broker Init for RHEL 8 (Multiarch)
- To obtain the URL of the init container image, repeat the steps that you followed to obtain the URL of the broker container image.
Edit the main broker CR instance for the broker deployment.
Using the OpenShift command-line interface:
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>
$ oc login -u <user> -p <password> --server=<host:port>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Edit the CR.
oc edit ActiveMQArtemis <CR instance name> -n <namespace>
oc edit ActiveMQArtemis <CR instance name> -n <namespace>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Using the OpenShift Container Platform web console:
- Log in to the console as a user that has privileges to deploy CRs in the project for the broker deployment.
-
In the left pane, click
. - Click the Red Hat Integration - AMQ Broker for RHEL 8 (Multiarch) operator.
- Click the AMQ Broker tab.
- Click the name of the ActiveMQArtemis instance name.
Click the YAML tab.
Within the console, a YAML editor opens, which enables you to configure the CR instance
Copy the URLs of the broker and init container images that you recorded in the text file and insert them in the
spec.deploymentPlan.imageandspec.deploymentPlan.initImagefields in the CR. For example:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Save the CR.
When you save the CR, the Operator upgrades the brokers to use the new images and uses these images until you update the values of the
spec.deploymentPlan.imageandspec.deploymentPlan.initImageattributes again.If you want to prevent future Operator upgrades from restarting the brokers in your deployment, edit the CR and and specify the version number of the brokers that are deployed in the
spec.versionattribute.If the
spec.versionattribute is not configured in the CR, subsequent upgrades of the Operator cause the broker pods to restart. The pod restart is required because the new Operator adds the latest supported broker version to a label in the StatefulSet unless a version number is explicitly set in thespec.versionattribute.You can find the version number value to specify for the
spec.versionattribute in thestatussection of the CR after the brokers start. For more information, see Viewing status information for your broker deployment.
If you already deployed AMQ Broker without setting image URLs, you can set the image URLs retrospectively to prevent the Operator from upgrading the current images deployed. You can find the registry URLs for the images deployed in the .status.version.image and .status.version.initImage attributes, which are in the status section of the CR.
If you copy the image URLs from the .status.version.image and .status.version.initImage attributes and insert them in the spec.deploymentPlan.image and the spec.deploymentPlan.initImage attributes respectively, the Operator does not upgrade the images currently deployed.
Additional Resources
- To view the status of the deployment, see Section 2.8, “Validation of image and version configuration in a custom resource (CR)”.