Upgrade Tanzu RabbitMQ for Kubernetes

Learn how to upgrade your Tanzu RabbitMQ for Kubernetes deployments to a newer version.

Prerequisites

The following prerequisites must be in place:

  • A running Kubernetes cluster
  • Kubernetes CLI tools such as kubectl are installed
  • The Carvel toolchain is installed locally

The Upgrade Procedures

To upgrade your Tanzu RabbitMQ for Kubernetes package, complete the following procedures in this order:

  • Upgrade the rabbitmq-cluster-operator and messaging-topology-operator Operators
  • Upgrade RabbitMQ Instances

Upgrade the Operators

Important

When you upgrade the rabbitmq-cluster-operator, you are updating the RabbitMQ clusters which causes a rolling update of the underlying StatefulSets. If you want to control when a RabbitMQ cluster gets updated, ensure to pause reconciliation before upgrading the rabbitmq-cluster-operator. After the rabbitmq-cluster-operator upgrade is complete, resume reconciliation whenever it is safe to update the RabbitMQ cluster.

Important

If your Tanzu RabbitMQ for Kubernetes deployments were previously installed on an airgapped network, then the kapp-controller docs were followed to relocate the package rabbitmq-kubernetes.packages.broadcom.com/tanzu-rabbitmq-package-repo to your internal registry, in the following upgrade instructions, you must now use the URL of your registry anywhere there are references to rabbitmq-kubernetes.packages.broadcom.com.

  1. To upgrade the operators, you must first update the PackageRepository for Tanzu RabbitMQ:
kubectl edit packagerepository tanzu-rabbitmq-repo
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageRepository
metadata:
   name: tanzu-rabbitmq-repo
spec:
   fetch:
      imgpkgBundle:
         image: rabbitmq-kubernetes.packages.broadcom.com/tanzu-rabbitmq-package-repo:${NEW_VERSION} # Replace with new release version
  1. After this is installed, verify that the expected new versions are visible to your client:
$ kubectl get packages
NAME                                      PACKAGEMETADATA NAME        VERSION           AGE
rabbitmq.tanzu.vmware.com.<NEW VERSION>   rabbitmq.tanzu.vmware.com   <NEW VERSION>     7s
rabbitmq.tanzu.vmware.com.1.2.0           rabbitmq.tanzu.vmware.com   1.2.0             7s
  1. Update the PackageInstall for the Tanzu RabbitMQ rabbitmq-cluster-operator and messaging-topology-operator operators:
kubectl edit packageinstall tanzu-rabbitmq
apiVersion: packaging.carvel.dev/v1alpha1
kind: PackageInstall
metadata:
   name: tanzu-rabbitmq
spec:
   serviceAccountName: ${SERVICE_ACCOUNT} # Replace with service account name
   packageRef:
      refName: rabbitmq.tanzu.vmware.com
      versionSelection:
         constraints: ${NEW_VERSION} # Replace with release version
  1. When the the command finishes, run kapp inspect -a tanzu-rabbitmq-ctrl to verify everything is running and all conditions (Conds column) are true. It should look similar to this:
# [...]
# rabbitmq-system  messaging-topology-leader-election-role         Role                            kapp     -       ok  -   9d
# ^                messaging-topology-leader-election-rolebinding  RoleBinding                     kapp     -       ok  -   9d
# ^                messaging-topology-operator                     Deployment                      kapp     2/2 t   ok  -   11s
# ^                messaging-topology-operator                     ServiceAccount                  kapp     -       ok  -   9d
# ^                messaging-topology-operator-59c887bf9b          ReplicaSet                      cluster  -       ok  -   11s
# ^                messaging-topology-operator-59c887bf9b-24z29    Pod                             cluster  4/4 t   ok  -   11s
# ^                rabbitmq-cluster-leader-election-role           Role                            kapp     -       ok  -   9d
# ^                rabbitmq-cluster-leader-election-rolebinding    RoleBinding                     kapp     -       ok  -   9d
# ^                rabbitmq-cluster-operator                       Deployment                      kapp     2/2 t   ok  -   11s
# ^                rabbitmq-cluster-operator                       ServiceAccount                  kapp     -       ok  -   9d
# ^                rabbitmq-cluster-operator-5c479456b             ReplicaSet                      cluster  -       ok  -   11s
# ^                rabbitmq-cluster-operator-5c479456b-lwsxf       Pod                             cluster  4/4 t   ok  -   11s
# [...]

The rabbitmq-cluster-operator and messaging-topology-operator upgrades should now be complete.

Upgrade the RabbitMQ Instances

Complete the following steps to upgrade individual RabbitMQ instances. Please note that this procedure restarts RabbitMQ in a rolling strategy; which means, it will restart one RabbitMQ pod at a time.

  1. Check that all feature flags are turned on. If they are not, turn them on.

  2. Use the following command to open the manifest for each RabbitmqCluster you wish to upgrade:

    kubectl edit rmq my-tanzu-rabbit
    # Replace 'my-tanzu-rabbit' with the name of your RabbitMQ cluster
    
  3. Remove the line containing image: in the spec and save & exit the file:

    [...]
    spec:
      image: dev.registry.pivotal.io/rabbitmq/vmware-tanzu-rabbitmq:1.2.0 # Remove this line
    [...]
    

This previous steps reset the image of the RabbitmqCluster to the default of the operator, which is the uplevel version of Tanzu RabbitMQ. This action triggers the rolling upgrade of your cluster.

  1. Turn on all feature flags again, refer to Feature Flags for the steps and more details.
check-circle-line exclamation-circle-line close-line
Scroll to top icon