Learn how to upgrade your Tanzu RabbitMQ for Kubernetes deployments to a newer version.
The following prerequisites must be in place:
kubectl
are installedTo upgrade your Tanzu RabbitMQ for Kubernetes package, complete the following procedures in this order:
rabbitmq-cluster-operator
and messaging-topology-operator
OperatorsImportantWhen 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 therabbitmq-cluster-operator
. After therabbitmq-cluster-operator
upgrade is complete, resume reconciliation whenever it is safe to update the RabbitMQ cluster.
ImportantIf 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 torabbitmq-kubernetes.packages.broadcom.com
.
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
$ 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
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
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.
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.
Check that all feature flags are turned on. If they are not, turn them on.
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
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.