This section contains 3 examples for creating RabbitMQ users.
Messaging Topology Operator creates users with generated credentials by default. To create RabbitMQ users with provided credentials, you can reference a kubernetes secret object contains keys username
and password
in its Data field.
See userPreDefinedCreds.yaml and publish-consume-user.yaml as examples.
From Messaging Topology Operator v1.10.0, you can provide a username and reply on the Operator to generate its password for you.
See setUsernamewithGenPass.yaml as an example.
Note that Messaging Topology Operator does not watch the provided secret and updating the secret object won't update actual user credentials.
The User controller will generate a new secret from the provided secret named by appending the suffix -user-credentials
to the username. For example, if your User is named user-test
the controller will generate a secret user-test-user-credentials
.
If you wish to update User credentials, you can update the secret generated by the controller and then add a label or annotation to the User object to trigger a reconcile loop.