Chapter 9. Upgrading a template-based broker deployment
The following procedures show how to upgrade the broker container image for a deployment that is based on application templates.
To upgrade an existing AMQ Broker deployment 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, before performing a clean installation of AMQ Broker that matches your existing deployment. To perform a clean AMQ Broker installation, use one of these methods:
The procedures show how to manually upgrade your image specifications between minor versions (for example, from
7.x
to7.y
). If you use a floating tag such as7.y
in your image specification, your deployment automatically pulls and uses new micro image versions (that is,7.y-z
) when they become available from Red Hat, provided that theimagePullPolicy
attribute in your StatefulSet or DeploymentConfig is set toAlways
.For example, suppose that the
image
attribute of your deployment specifies a floating tag of7.8
. If the deployment currently uses minor version7.8-5
, and a newer minor version,7.8-6
, becomes available in the registry, then your deployment automatically pulls and uses the new minor version. To use the new image, each broker Pod in the deployment is restarted. If you have multiple brokers in your deployment, brokers Pods are restarted one at a time.
9.1. Upgrading non-persistent broker deployments
This procedure shows you how to upgrade a non-persistent broker deployment. The non-persistent broker templates in the OpenShift Container Platform service catalog have labels that resemble the following:
- Red Hat AMQ Broker 7.x (Ephemeral, no SSL)
- Red Hat AMQ Broker 7.x (Ephemeral, with SSL)
- Red Hat AMQ Broker 7.x (Custom Config, Ephemeral, no SSL)
Prerequisites
- Starting in AMQ Broker 7.3, you use a new version of the Red Hat Ecosystem Catalog to access container images. This new version of the registry requires you to become an authenticated user before you can access images and pull them into an OpenShift project. Before following the procedure in this section, you must first complete the steps described in Red Hat Container Registry Authentication.
Procedure
- Navigate to the OpenShift Container Platform web console and log in.
- Click the project in which you want to upgrade a non-persistent broker deployment.
Select the DeploymentConfig (DC) corresponding to your broker deployment.
-
In OpenShift Container Platform 4.5 or later, click
. -
In OpenShift Container Platform 3.11, click
. Within your broker deployment, click the Configuration tab.
-
In OpenShift Container Platform 4.5 or later, click
From the Actions menu, click Edit DeploymentConfig (OpenShift Container Platform 4.5 or later) or Edit YAML (OpenShift Container Platform 3.11).
The YAML tab of the DeploymentConfig opens, with the
.yaml
file in an editable mode.-
Edit the
image
attribute to specify the latest AMQ Broker 7.8 container image,registry.redhat.io/amq7/amq-broker:7.8
. Add the
imagePullSecrets
attribute to specify the image pull secret associated with the account used for authentication in the Red Hat Container Registry.Changes based on the previous two steps are shown in the example below:
... spec: containers: image: 'registry.redhat.io/amq7/amq-broker:7.8' .. imagePullSecrets: - name: {PULL-SECRET-NAME}
NoteIn AMQ Broker, container image tags increment by
1
for each new version of the container image added to the Red Hat image registry, for example, 7.8-1, 7.8-2, and so on. If you specify a tag name without a final digit (7.8
, for example), this tag is known as a floating tag. When you specify a floating tag, OpenShift Container Platform automatically identifies the most recent available image (that is, the image tag with the highest final number) and uses this image to upgrade your broker deployment.Click Save.
If a newer broker image than the one currently installed is available from Red Hat, OpenShift Container Platform upgrades your broker deployment. To do this, OpenShift Container Platform stops the existing broker Pod and then starts a new Pod that uses the new image.
9.2. Upgrading persistent broker deployments
This procedure shows you how to upgrade a persistent broker deployment. The persistent broker templates in the OpenShift Container Platform service catalog have labels that resemble the following:
- Red Hat AMQ Broker 7.x (Persistence, clustered, no SSL)
- Red Hat AMQ Broker 7.x (Persistence, clustered, with SSL)
- Red Hat AMQ Broker 7.x (Persistence, with SSL)
Prerequisites
- Starting in AMQ Broker 7.3, you use a new version of the Red Hat Ecosystem Catalog to access container images. This new version of the registry requires you to become an authenticated user before you can access images and pull them into an OpenShift project. Before following the procedure in this section, you must first complete the steps described in Red Hat Container Registry Authentication.
Procedure
- Navigate to the OpenShift Container Platform web console and log in.
- Click the project in which you want to upgrade a persistent broker deployment.
Select the StatefulSet (SS) corresponding to your broker deployment.
-
In OpenShift Container Platform 4.5 or later, click
. -
In OpenShift Container Platform 3.11, click
.
-
In OpenShift Container Platform 4.5 or later, click
From the Actions menu, click Edit StatefulSet (OpenShift Container Platform 4.5 or later) or Edit YAML (OpenShift Container Platform 3.11).
The YAML tab of the StatefulSet opens, with the
.yaml
file in an editable mode.To prepare your broker deployment for upgrade, scale the deployment down to zero brokers.
-
If the
replicas
attribute is currently set to1
or greater, set it to0
. - Click Save.
-
If the
-
When all broker Pods have shut down, edit the StatefulSet
.yaml
file again. Edit theimage
attribute to specify the latest AMQ Broker 7.8 container image,registry.redhat.io/amq7/amq-broker:7.8
. Add the
imagePullSecrets
attribute to specify the image pull secret associated with the account used for authentication in the Red Hat Container Registry.Changes based on the previous two steps are shown in the example below:
... spec: containers: image: 'registry.redhat.io/amq7/amq-broker:7.8' .. imagePullSecrets: - name: {PULL-SECRET-NAME}
-
Set the
replicas
attribute back to the original value. Click Save.
If a newer broker image than the one currently installed is available from Red Hat, OpenShift Container Platform upgrades your broker deployment. To do this, OpenShift Container Platform restarts the broker Pod.