RabbitMQ is HA architecture
Rabbitmq log
RabbitMQ internally uses the Mnesia database to synchronize cluster state. When all nodes in an HA cluster have been shut down, RabbitMQ stipulates that “the last node shut down must be the first to start.”
Therefore, in your current situation: the Pod does not believe it is the last node to be shut down, hence the error. The solution is as follows.
Shutting down RabbitMQ using the scale command:
kubectl -n ensaas-db scale sts rabbitmq-rabbitmq-ha --replicas=0
Deleting the RabbitMQ PVC (the HA architecture will have 3 PVCs):
kubectl -n ensaas-db delete pvc $rabbitmq-pvc-name
Restarting RabbitMQ using the scale command:
kubectl -n ensaas-db scale sts rabbitmq-rabbitmq-ha --replicas=3