Overview

Version 1.2.0+ of VMware Tanzu RabbitMQ for Kubernetes leverages the kapp-controller framework to allow for easy installation and management of the RabbitMQ operators and OCI images. If you are upgrading to version 1.2.0+ from any version 1.1.*, some additional steps are required to upgrade.

Prerequisite

This guide assumes you have the following:

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

If not already installed on your Kubernetes cluster, you will also need to install kapp-controller v0.28.0+, secretgen-controller v0.5.0+ and cert-manager v1.5.0+ on your cluster:

kapp deploy -a kc -y -f https://github.com/vmware-tanzu/carvel-kapp-controller/releases/latest/download/release.yml
kapp deploy -a sg -y -f https://github.com/vmware-tanzu/carvel-secretgen-controller/releases/latest/download/release.yml
kapp deploy -a cert-manager -y -f https://github.com/jetstack/cert-manager/releases/latest/download/cert-manager.yaml

Upgrade

The procedure to upgrade using the bundle consists of the following steps:

  • (Optional) Relocate the new bundle
  • Upgrade Cluster Operator and Topology Operator
  • Upgrade RabbitMQ instances

Relocate the new bundle

If you are planning on deploying VMware Tanzu RabbitMQ for Kubernetes to a Kubernetes cluster on an airgapped network, you must first follow the instructions on the kapp-controller docs to relocate the package registry.tanzu.vmware.com/p-rabbitmq-for-kubernetes/tanzu-rabbitmq-package-repo to your internal registry. In the below instructions, you should use the URL of your registry in place of any references to registry.tanzu.vmware.com.

Procedure to upgrade Operators

The upgrade process will upgrade the Cluster Operator and the Topology Operator, while installing the new Standby Replication Operator. RabbitMQ instances will not be upgraded in this step. RabbitMQ instances can be upgraded as a separate step, and as needed.

To upgrade Tanzu RabbitMQ, follow this procedure:

  1. Check the existing Operators, make sure they are running.

      kapp -n default inspect -a rabbitmq-operator
      # [...]
      # 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  -   9d
      # ^                messaging-topology-operator                     ServiceAccount                  kapp     -       ok  -   9d
      # ^                messaging-topology-operator-59c887bf9b          ReplicaSet                      cluster  -       ok  -   2d
      # ^                messaging-topology-operator-59c887bf9b-zntdg    Pod                             cluster  4/4 t   ok  -   2d
      # ^                messaging-topology-operator-7df4b4c88b          ReplicaSet                      cluster  -       ok  -   9d
      # ^                messaging-topology-operator-b5c8bdd5f           ReplicaSet                      cluster  -       ok  -   9d
      # ^                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  -   9d
      # ^                rabbitmq-cluster-operator                       ServiceAccount                  kapp     -       ok  -   9d
      # ^                rabbitmq-cluster-operator-5688599bc9            ReplicaSet                      cluster  -       ok  -   9d
      # ^                rabbitmq-cluster-operator-5c479456b             ReplicaSet                      cluster  -       ok  -   2d
      # ^                rabbitmq-cluster-operator-5c479456b-n4jxb       Pod                             cluster  4/4 t   ok  -   2d
      # ^                rabbitmq-cluster-operator-6f87c7bbf8            ReplicaSet                      cluster  -       ok  -   9d
      # [...]
    
  2. Rename the existing deployment containing the operators to tanzu-rabbitmq-ctrl exactly:

    kapp rename -a rabbitmq-operator --new-name tanzu-rabbitmq-ctrl -y
    
  3. Follow the instructions under the Setup section of the installation guide. N.B.: if you are upgrading from version 1.1.0 only to 1.2.0, the PackageInstall manifest you use in those instructions must be as follows:

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: 1.2.0
  values:
  - secretRef:
      name: tanzu-rabbitmq-values
---
apiVersion: v1
kind: Secret
metadata:
  name: tanzu-rabbitmq-values
stringData:
  values.yml: |
    ---
    upgrade110To120: true

Once 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
# [...]

At this point, the upgrade of the Operators is completed.

Procedure to upgrade RabbitMQ instances

The following procedure documents how to upgrade individual RabbitMQ instances. Please note that this procedure will restart RabbitMQ in a rolling strategy; in other words, it will restart one RabbitMQ Pod at a time.

  1. 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
    
  2. Remove the line containing image: in the spec and save & exit the file:
    [...]
    spec:
      image: dev.registry.pivotal.io/rabbitmq/vmware-tanzu-rabbitmq:1.1.1 # Remove this line
    [...]
    

This will reset the image of the RabbitmqCluster to the default of the operator, which will be the uplevel version of Tanzu RabbitMQ. This will trigger the rolling upgrade of your cluster.

check-circle-line exclamation-circle-line close-line
Scroll to top icon