Skip to content

Commit d5ed43d

Browse files
committed
Add example for predefined username
1 parent 598d0c8 commit d5ed43d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

docs/examples/users/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
This section contains 3 examples for creating RabbitMQ users.
44
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.
55
See [userPreDefinedCreds.yaml](./userPreDefinedCreds.yaml) and [publish-consume-user.yaml](./publish-consume-user.yaml) as examples.
6+
From [Messaging Topology Operator v1.10.0](https://github.com/rabbitmq/messaging-topology-operator/releases/tag/v1.10.1), you can provide a username and reply on the Operator to generate its password for you.
7+
See [setUsernamewithGenPass.yaml](./setUsernamewithGenPass.yaml) as an example.
8+
69
Note that Messaging Topology Operator does not watch the provided secret and updating the secret object won't update actual user credentials.
710
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`.
811
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.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: user-creds
5+
type: Opaque
6+
stringData:
7+
username: test
8+
---
9+
apiVersion: rabbitmq.com/v1beta1
10+
kind: User
11+
metadata:
12+
name: set-username-gen-pass-example
13+
spec:
14+
tags:
15+
- management
16+
rabbitmqClusterReference:
17+
name: test # rabbitmqCluster must exist in the same namespace as this resource
18+
importCredentialsSecret:
19+
name: user-creds

0 commit comments

Comments
 (0)